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

update pre-commit hooks #363

Closed
wants to merge 3 commits into from
Closed
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
19 changes: 14 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
Expand All @@ -11,8 +11,17 @@ repos:
exclude: ".*\\.[fidl|jsonschema]"
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/pycqa/flake8
rev: '7.0.0'
- repo: https://github.com/psf/black
rev: 23.10.1
hooks:
- id: flake8
- id: black
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.10
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format
31 changes: 31 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,34 @@ build-backend = "setuptools.build_meta"
[tool.setuptools-git-versioning]
# Starting version is just a dummy value that never shall be used in CI
starting_version = "0.0.0"

[tool.black]
line-length=120

[tool.ruff]
line-length = 120
target-version = "py310"
exclude = [
".venv",
"binary",
"dist",
"obsolete",
]

[tool.ruff.lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
select = ["E4", "E7", "E9", "F"]
extend-select = [
"UP", # pyupgrade
]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[tool.ruff.format]
quote-style = "double" # like Black, use double quotes for strings
indent-style = "space" # like Black, indent with spaces, rather than tabs
skip-magic-trailing-comma = false # like Black, respect magic trailing commas
line-ending = "auto" # like Black, automatically detect the appropriate line ending