From dd6b8e6bf177366482216fefc136b39e2c50dc1f Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Fri, 22 Mar 2024 11:54:43 +0800 Subject: [PATCH] :wrench: update ruff config --- pyproject.example.toml | 47 +++++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/pyproject.example.toml b/pyproject.example.toml index 060b86d..c720603 100644 --- a/pyproject.example.toml +++ b/pyproject.example.toml @@ -17,17 +17,9 @@ python = "^3.8" [tool.poetry.group.dev.dependencies] ruff = "^0.3.0" isort = "^5.10.1" -black = "^24.0.0" nonemoji = "^0.1.2" pre-commit = "^3.1.0" -[tool.black] -line-length = 88 -target-version = ["py38", "py39", "py310", "py311"] -include = '\.pyi?$' -extend-exclude = ''' -''' - [tool.isort] profile = "black" line_length = 88 @@ -40,14 +32,49 @@ extra_standard_library = ["typing_extensions"] line-length = 88 target-version = "py38" +[tool.ruff.format] +line-ending = "lf" + [tool.ruff.lint] -select = ["E", "W", "F", "UP", "C", "T", "PYI", "PT", "Q"] -ignore = ["C901"] +select = [ + "F", # Pyflakes + "W", # pycodestyle warnings + "E", # pycodestyle errors + # "I", # isort + "UP", # pyupgrade + "ASYNC", # flake8-async + "C4", # flake8-comprehensions + "T10", # flake8-debugger + "T20", # flake8-print + "PYI", # flake8-pyi + "PT", # flake8-pytest-style + "Q", # flake8-quotes + "TID", # flake8-tidy-imports + "RUF", # Ruff-specific rules +] +ignore = [ + "E402", # module-import-not-at-top-of-file + "RUF001", # ambiguous-unicode-character-string + "RUF002", # ambiguous-unicode-character-docstring + "RUF003", # ambiguous-unicode-character-comment +] + +[tool.ruff.lint.per-file-ignores] +"githubkit/rest/**" = ["E501", "PYI016", "TID"] +"githubkit/versions/**" = ["E501", "PYI016", "TID"] + +[tool.ruff.lint.isort] +length-sort = true +force-sort-within-sections = true +extra-standard-library = ["typing_extensions"] [tool.ruff.lint.flake8-pytest-style] fixture-parentheses = false mark-parentheses = false +[tool.ruff.lint.pyupgrade] +keep-runtime-typing = true + [build-system] requires = ["poetry_core>=1.0.0"] build-backend = "poetry.core.masonry.api"