Skip to content

Commit

Permalink
🔧 update ruff config
Browse files Browse the repository at this point in the history
  • Loading branch information
yanyongyu authored Mar 22, 2024
1 parent d11244d commit dd6b8e6
Showing 1 changed file with 37 additions and 10 deletions.
47 changes: 37 additions & 10 deletions pyproject.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"

0 comments on commit dd6b8e6

Please sign in to comment.