|
| 1 | +# Legacy sphinx config; excluded until it is removed in the docs phase |
1 | 2 | exclude: '^docs/conf.py' |
2 | 3 |
|
3 | 4 | minimum_pre_commit_version: 3.2.0 |
4 | 5 | repos: |
5 | | -- repo: https://github.com/pre-commit/pre-commit-hooks |
6 | | - rev: v5.0.0 |
7 | | - hooks: |
8 | | - - id: trailing-whitespace |
9 | | - - id: check-added-large-files |
10 | | - - id: check-ast |
11 | | - - id: check-json |
12 | | - - id: check-merge-conflict |
13 | | - - id: check-xml |
14 | | - - id: check-yaml |
15 | | - - id: debug-statements |
16 | | - - id: end-of-file-fixer |
17 | | - - id: requirements-txt-fixer |
18 | | - - id: mixed-line-ending |
19 | | - args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows |
| 6 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 7 | + rev: v6.0.0 |
| 8 | + hooks: |
| 9 | + - id: trailing-whitespace |
| 10 | + - id: check-added-large-files |
| 11 | + - id: check-ast |
| 12 | + - id: check-case-conflict |
| 13 | + - id: check-json |
| 14 | + - id: check-merge-conflict |
| 15 | + - id: check-toml |
| 16 | + - id: check-xml |
| 17 | + - id: check-yaml |
| 18 | + - id: debug-statements |
| 19 | + - id: end-of-file-fixer |
| 20 | + - id: mixed-line-ending |
| 21 | + args: ['--fix=auto'] |
20 | 22 |
|
21 | | -# If you want to avoid flake8 errors due to unused vars or imports: |
22 | | -- repo: https://github.com/myint/autoflake |
23 | | - rev: v2.3.1 |
24 | | - hooks: |
25 | | - - id: autoflake |
26 | | - args: [ |
27 | | - --in-place, |
28 | | - --remove-all-unused-imports, |
29 | | - --remove-unused-variables, |
30 | | - ] |
31 | | - |
32 | | -- repo: https://github.com/pycqa/isort |
33 | | - rev: 5.13.2 |
34 | | - hooks: |
35 | | - - id: isort |
36 | | - |
37 | | -- repo: https://github.com/psf/black |
38 | | - rev: 24.10.0 |
39 | | - hooks: |
40 | | - - id: black |
41 | | - language_version: python3 |
42 | | - |
43 | | -## If like to embrace black styles even in the docs: |
44 | | -# - repo: https://github.com/asottile/blacken-docs |
45 | | -# rev: v1.12.0 |
46 | | -# hooks: |
47 | | -# - id: blacken-docs |
48 | | -# additional_dependencies: [black] |
49 | | - |
50 | | -- repo: https://github.com/PyCQA/flake8 |
51 | | - rev: 7.1.1 |
52 | | - hooks: |
53 | | - - id: flake8 |
54 | | - ## You can add flake8 plugins via `additional_dependencies`: |
55 | | - additional_dependencies: [flake8-bugbear] |
| 23 | + # ruff replaces autoflake, isort, black and flake8(+bugbear) |
| 24 | + - repo: https://github.com/astral-sh/ruff-pre-commit |
| 25 | + rev: v0.15.7 |
| 26 | + hooks: |
| 27 | + - id: ruff-check |
| 28 | + args: [--exit-non-zero-on-fix] |
| 29 | + - id: ruff-format |
0 commit comments