Skip to content

Commit

Permalink
update deprecated ruff usage and config
Browse files Browse the repository at this point in the history
  • Loading branch information
sjvrijn committed May 3, 2024
1 parent f5b0ad1 commit 58fb424
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 27 deletions.
2 changes: 1 addition & 1 deletion {{cookiecutter.directory_name}}/.githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo "Script $0 triggered ..."
echo "Starting ruff analysis..."

# quietly run ruff
ruff . --fix
ruff check . --fix

# use return code to abort commit if necessary
if [ $? != "0" ]; then
Expand Down
56 changes: 30 additions & 26 deletions {{cookiecutter.directory_name}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,35 @@ extras = dev
"""

[tool.ruff]
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
".venv",
"scripts",
]

target-version = "py39"
line-length = 120


[tool.ruff.lint]
# Enable Pyflakes `E` and `F` codes by default.
select = [
"F", # Pyflakes
Expand Down Expand Up @@ -131,39 +160,14 @@ ignore = [
fixable = ["A", "B", "C", "D", "E", "F", "I"]
unfixable = []

exclude = [
".bzr",
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
".venv",
"scripts",
]
per-file-ignores = {}


# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

target-version = "py39"
line-length = 120

[tool.ruff.isort]
[tool.ruff.lint.isort]
known-first-party = ["{{ cookiecutter.package_name }}"]
force-single-line = true
no-lines-before = ["future","standard-library","third-party","first-party","local-folder"]
Expand Down

0 comments on commit 58fb424

Please sign in to comment.