DeepAudit icon indicating copy to clipboard operation
DeepAudit copied to clipboard

Should we run ruff format on the codebase?

Open huhusmang opened this issue 1 week ago • 4 comments

我注意到项目已经在 pyproject.toml 中配置了 Ruff,但代码库中似乎还有不少 format 不规范的代码。For example in backend/app/api/v1/endpoints/config.py :

from typing import Any, Optional
from fastapi import APIRouter, Depends, HTTPException
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.future import select
from pydantic import BaseModel
import json

Import 的顺序是不太合理的

huhusmang avatar Dec 19 '25 11:12 huhusmang

感谢反馈

lintsinghua avatar Dec 19 '25 12:12 lintsinghua

当前阶段暂未进行代码格式规范整理,待系统功能迭代稳定后会单独安排相关工作,请持续关注。

lintsinghua avatar Dec 19 '25 12:12 lintsinghua

format 应该是 commit 自动触发的,这样其他人参与贡献才能更好的统一代码风格吧

huhusmang avatar Dec 19 '25 12:12 huhusmang

这个建议很好,后续会设计在Actions流水线中添加 ruff format --check 步骤

lintsinghua avatar Dec 19 '25 12:12 lintsinghua