Skip to content

Commit

Permalink
fix: reduce number of commit hooks to minimum
Browse files Browse the repository at this point in the history
  • Loading branch information
12rambau authored Dec 29, 2023
1 parent d43642f commit 9cb1dc9
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 47 deletions.
72 changes: 27 additions & 45 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,59 +1,41 @@
ci:
autoupdate_schedule: monthly
autoupdate_commit_msg: "chore: update pre-commit hooks"

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
- repo: "https://github.com/psf/black"
rev: "22.3.0"
hooks:
- id: check-case-conflict
- id: check-ast
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-json
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
- id: black

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.27.1
- repo: "https://github.com/kynan/nbstripout"
rev: "0.5.0"
hooks:
- id: check-github-workflows
- id: nbstripout

- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
- repo: "https://github.com/pre-commit/mirrors-prettier"
rev: "v2.7.1"
hooks:
- id: mdformat
- id: prettier
exclude: tests\/test_.+\.

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.3"
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.215"
hooks:
- id: prettier
types_or: [yaml, html, json]
- id: ruff

- repo: https://github.com/codespell-project/codespell
rev: "v2.2.6"
- repo: https://github.com/PyCQA/doc8
rev: "v1.1.1"
hooks:
- id: codespell
args: ["-L", "sur,nd"]
- id: doc8

- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.10.0"
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal
- id: codespell
stages: [commit]
additional_dependencies:
- tomli

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.5
# Prevent committing inline conflict markers
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: ruff
types_or: [python, jupyter]
args: ["--fix", "--show-fixes"]
- id: ruff-format
types_or: [python, jupyter]
- id: check-merge-conflict
args: [--assume-in-merge]
26 changes: 24 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,27 @@ filterwarnings = [
"module:datetime.datetime.utc:DeprecationWarning"
]

[tool.repo-review]
ignore = ["GH102", "MY100", "RF001", "PY007", "GH103", "PC140"]
[tool.ruff]
ignore-init-module-imports = true
fix = true
select = ["E", "F", "W", "I", "D", "RUF"]
ignore = [
"E501", # line too long | Black take care of it
"W605", # invalid escape sequence | we escape specific characters for sphinx
"D212", # Multi-line docstring | we use a different convention, too late
"D101", # Missing docstring in public class | we use a different convention, too late
]

[tool.ruff.flake8-quotes]
docstring-quotes = "double"

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

[tool.black]
line-length = 100

[tool.doc8]
ignore = [
"D001" # we follow a 1 line = 1 paragraph style
]

0 comments on commit 9cb1dc9

Please sign in to comment.