[tool.ruff] target-version = "py311" line-length = 120 [tool.ruff.lint] select = [ "E", # pycodestyle errors "F", # pyflakes "W", # pycodestyle warnings "I", # isort "B", # flake8-bugbear "UP", # pyupgrade "SIM", # flake8-simplify "RET", # flake8-return "ARG", # flake8-unused-arguments ] ignore = [ "E402", # module-import-not-at-top-of-file(循环导入导致的延迟导入很多) "E501", # line-too-long(black已经管了) "UP006", # use-list-type (太多了,3.9+才支持,项目目标3.11但历史代码多) "UP007", # use-union-type "B008", # do-not-perform-callback-from-arg (fastapi依赖注入常用) "ARG001",# unused-function-argument (接口方法参数多,框架注入) "ARG002",# unused-method-argument "RET501",# do-not-use-return-None "RET502",# do-not-implicitly-return-None "SIM108",# use-ternary-operator (可读性考虑) ] [tool.ruff.lint.per-file-ignores] "tests/*" = ["B011", "S101"] "apps/*/migrations/*" = ["ALL"] "alembic/*" = ["ALL"] [tool.ruff.format] quote-style = "double" indent-style = "space"