Skip to content

Commit

Permalink
update precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhi committed Apr 12, 2023
1 parent 5862cff commit 4f9be9b
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 22 deletions.
31 changes: 9 additions & 22 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ ci:
autoupdate_schedule: "quarterly"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: check-docstring-first
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 22.8.0
rev: 23.3.0
hooks:
- id: black

- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.5.2
rev: 1.7.0
hooks:
- id: nbqa-black
- id: nbqa-isort
Expand All @@ -30,25 +30,12 @@ repos:
- id: nbstripout

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.0
rev: v3.0.0-alpha.6
hooks:
- id: prettier

- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.256
hooks:
- id: flake8
additional_dependencies: [flake8-typing-imports==1.7.0]

- repo: https://github.com/PyCQA/autoflake
rev: v1.6.1
hooks:
- id: autoflake
args:
[
"--exclude=mpl_interactions/ipyplot.py",
"--in-place",
"--remove-all-unused-imports",
"--ignore-init-module-imports",
"--remove-unused-variables",
]
- id: ruff
args: [--fix]
35 changes: 35 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,38 @@ addopts = [
"--mpl",
"--nbval",
]


# https://github.com/charliermarsh/ruff
[tool.ruff]
line-length = 88
target-version = "py38"
extend-select = [
"E", # style errors
"F", # flakes
"D", # pydocstyle
"I001", # isort
"U", # pyupgrade
# "N", # pep8-naming
# "S", # bandit
"C", # flake8-comprehensions
"B", # flake8-bugbear
"A001", # flake8-builtins
"RUF", # ruff-specific rules
"M001", # Unused noqa directive
]
extend-ignore = [
"D100", # Missing docstring in public module
"D107", # Missing docstring in __init__
"D203", # 1 blank line required before class docstring
"D212", # Multi-line docstring summary should start at the first line
"D213", # Multi-line docstring summary should start at the second line
"D413", # Missing blank line after last section
"D416", # Section name should end with a colon
]


[tool.ruff.per-file-ignores]
"tests/*.py" = ["D"]
"__init__.py" = ["E402"]
"docs/conf.py" = ["A001", "C901", "D200", "D400", "D415"]

0 comments on commit 4f9be9b

Please sign in to comment.