Skip to content

Commit

Permalink
Chore: update ruff and pre-commit hook (#381)
Browse files Browse the repository at this point in the history
* chore: updated pyproject.toml to solve warnings

* ci: updated ruff-pre-commit version hook
  • Loading branch information
raffaellasuardini authored Feb 18, 2024
1 parent 8f5c0ae commit a70c194
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ repos:
- id: check-merge-conflict
- id: mixed-line-ending

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.264"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.1
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
31 changes: 16 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
[tool.ruff]
# https://beta.ruff.rs/docs/configuration/
exclude = [
".eggs",
".git",
".mypy_cache",
".ruff_cache",
".env",
".venv",
"**migrations/**",
"node_modules",
"venv",
]
line-length = 120

[tool.ruff.lint]
# https://beta.ruff.rs/docs/configuration/
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
Expand All @@ -15,18 +28,6 @@ select = [
"UP", # pyupgrade
]

exclude = [
".eggs",
".git",
".mypy_cache",
".ruff_cache",
".env",
".venv",
"**migrations/**",
"node_modules",
"venv",
]

ignore = [
"B006", # Do not use mutable data structures for argument defaults
"B011", # tests use assert False
Expand All @@ -43,12 +44,12 @@ ignore = [
"UP007", # Use `X | Y` for type annotations
]

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = [
"F401" # unused-import
]

[tool.ruff.isort]
[tool.ruff.lint.isort]
combine-as-imports = true
known-first-party = [
"djangocms_versioning",
Expand Down

0 comments on commit a70c194

Please sign in to comment.