Skip to content

Commit 08d8e3e

Browse files
committed
refactor(pre-commit): Update pre-commit configuration with comprehensive linting and formatting hooks
1 parent b19420f commit 08d8e3e

1 file changed

Lines changed: 42 additions & 26 deletions

File tree

.pre-commit-config.yaml

Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,45 @@
1-
---
21
# See https://pre-commit.com for more information
32
# See https://pre-commit.com/hooks.html for more hooks
43
repos:
5-
- repo: local
6-
hooks:
7-
8-
- id: black
9-
name: Format with Black
10-
entry: poetry run black
11-
language: system
12-
types: [python]
13-
14-
- id: ruff
15-
name: Check with Ruff
16-
entry: poetry run ruff
17-
language: system
18-
pass_filenames: false
19-
always_run: true
20-
args: ["check", "src", "tests", "--fix"]
21-
22-
- id: mypy
23-
name: Validate types with MyPy
24-
entry: poetry run mypy
25-
language: system
26-
types: [python]
27-
pass_filenames: false
28-
args:
29-
- "src"
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v5.0.0
6+
hooks:
7+
- id: check-added-large-files
8+
- id: check-json
9+
- id: check-toml
10+
- id: check-yaml
11+
args: [--allow-multiple-documents]
12+
- id: detect-private-key
13+
- id: end-of-file-fixer
14+
exclude: ^requirements(-dev)?\.txt$
15+
- id: requirements-txt-fixer
16+
exclude: ^requirements(-dev)?\.txt$
17+
- id: trailing-whitespace
18+
exclude: ^tests/.*data/.*$
19+
- id: name-tests-test
20+
args: [--pytest-test-first]
21+
- repo: https://github.com/astral-sh/ruff-pre-commit
22+
# Ruff version.
23+
rev: v0.12.7
24+
hooks:
25+
# Run the linter.
26+
- id: ruff
27+
args:
28+
[
29+
"--fix",
30+
"--select=ALL",
31+
"--ignore=RUF100,BLE001,COM812,ISC001,D100,D104,D105,D107,D205,D211,D212,E203,E266,ANN204,ANN401,S602,ERA001,PGH003,PLR0913,TRY400,N803,N815,UP046",
32+
"--line-length=100",
33+
]
34+
# Run the formatter.
35+
- id: ruff-format
36+
- repo: https://github.com/PyCQA/pylint
37+
rev: v3.3.7
38+
hooks:
39+
- id: pylint
40+
args:
41+
- "--rcfile=pylintrc"
42+
# run pylint across multiple cpu cores to speed it up-
43+
# https://pylint.pycqa.org/en/latest/user_guide/run.html?#parallel-execution to know more
44+
- "--jobs=0"
45+
- "--fail-under=9.0" # minimum score to pass pylint

0 commit comments

Comments
 (0)