Skip to content

Commit

Permalink
Install ruff pre-commit-hook
Browse files Browse the repository at this point in the history
Install ruff with autofix, list hook at the top.
Port settings from flake8 to ruff.
  • Loading branch information
ThomasMarwitzQC committed Nov 6, 2023
1 parent 2b10cbb commit 359a7cd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
11 changes: 0 additions & 11 deletions .flake8

This file was deleted.

11 changes: 6 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
repos:
# Run ruff first because autofix behaviour is enabled
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.3
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/Quantco/pre-commit-mirrors-black
rev: 23.7.0
hooks:
- id: black-conda
args:
- --safe
- --target-version=py38
- repo: https://github.com/Quantco/pre-commit-mirrors-flake8
rev: 6.1.0
hooks:
- id: flake8-conda
additional_dependencies: [-c, conda-forge, flake8-docstrings=1.5.0, flake8-rst-docstrings=0.0.14]
- repo: https://github.com/Quantco/pre-commit-mirrors-isort
rev: 5.12.0
hooks:
Expand Down
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,21 @@ exclude = '''
)/
'''

[tool.ruff]
line-length = 88
target-version = "py310"

ignore = ["E203", "E266", "E501", "C901", "D104", "D100"]
select = ["B", "C", "E", "F", "W", "B9", "D"]

[tool.ruff.per-file-ignores]
"tests/*" = ["D101", "D102", "D103", "E402"]
"tests/test_azure_store.py" = ["B018"]
"tests/storefact/test_urls.py" = ["C408"]

[tool.ruff.pydocstyle]
convention = "numpy"

[tool.isort]
multi_line_output = 3
include_trailing_comma = true
Expand Down

0 comments on commit 359a7cd

Please sign in to comment.