Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update ruff.toml #13

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 30 additions & 29 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,30 @@ target-version = "py39"
include = ["**/pyproject.toml", "*.py", "*.pyi"]
extend-include = ["*.ipynb"]

# Exclude a variety of commonly ignored directories (you can have some problems)
exclude = [
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
".venv"
]

[lint]
# Rules: https://beta.ruff.rs/docs/rules/
# Enable Pyflakes `E` and `F` codes by default.
select = [
Expand Down Expand Up @@ -40,38 +64,15 @@ ignore = [
"D213", # Multi-line docstring summary should start at the second line
"D417", # Missing argument description in the docstring for {definition}: {name}
"E501", # Line too long ({width} > {limit} characters)
"E501", # line too long, handled by black
"D100",
]

# Always autofix, but never try to fix `F401` (unused imports).
fix = true
fixable = ["ALL"]
unfixable = ["F401"]

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = ">=(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# Exclude a variety of commonly ignored directories (you can have some problems)
exclude = [
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
".venv"
]

[format]
# select = ["E4", "E7", "E9", "F"]
Expand All @@ -82,19 +83,19 @@ indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"

[mccabe]
[lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10

[flake8-quotes]
[lint.flake8-quotes]
docstring-quotes = "double"

[pydocstyle]
[lint.pydocstyle]
convention = "google"

[isort]
[lint.isort]
known-third-party = ["fastapi", "pydantic", "starlette"]

[per-file-ignores]
[lint.per-file-ignores]
"__init__.py" = ["D104", "F401", "I002"]
"test*.py" = ["S101", "T201"]
59 changes: 30 additions & 29 deletions {{cookiecutter.directory_name}}/.ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,30 @@ target-version = "py39"
include = ["**/pyproject.toml", "*.py", "*.pyi"]
extend-include = ["*.ipynb"]

# Exclude a variety of commonly ignored directories (you can have some problems)
exclude = [
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
".venv"
]

[lint]
# Rules: https://beta.ruff.rs/docs/rules/
# Enable Pyflakes `E` and `F` codes by default.
select = [
Expand Down Expand Up @@ -40,38 +64,15 @@ ignore = [
"D213", # Multi-line docstring summary should start at the second line
"D417", # Missing argument description in the docstring for {definition}: {name}
"E501", # Line too long ({width} > {limit} characters)
"E501", # line too long, handled by black
"D100",
]

# Always autofix, but never try to fix `F401` (unused imports).
fix = true
fixable = ["ALL"]
unfixable = ["F401"]

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = ">=(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# Exclude a variety of commonly ignored directories (you can have some problems)
exclude = [
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
".venv"
]

[format]
# select = ["E4", "E7", "E9", "F"]
Expand All @@ -82,19 +83,19 @@ indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"

[mccabe]
[lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10

[flake8-quotes]
[lint.flake8-quotes]
docstring-quotes = "double"

[pydocstyle]
[lint.pydocstyle]
convention = "google"

[isort]
[lint.isort]
known-third-party = ["fastapi", "pydantic", "starlette"]

[per-file-ignores]
[lint.per-file-ignores]
"__init__.py" = ["D104", "F401", "I002"]
"test*.py" = ["S101", "T201"]