|
| 1 | +# pre-commit: A framework for managing and maintaining multi-language pre-commit hooks |
| 2 | +# after configuration is complete, do these steps: |
| 3 | + # pre-commit install |
| 4 | + # pre-commit run --all-files |
| 5 | +# to skip pre-commmit-config when git-committing in terminal, add this: "--no-verify" option. |
| 6 | + |
| 7 | +ci: |
| 8 | + autoupdate_commit_msg: "chore: update pre-commit hooks" |
| 9 | + autofix_commit_msg: "style: pre-commit fixes" |
| 10 | + |
| 11 | +repos: |
| 12 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 13 | + rev: v4.5.0 |
| 14 | + hooks: |
| 15 | + - id: check-added-large-files |
| 16 | + - id: check-case-conflict |
| 17 | + - id: check-merge-conflict |
| 18 | + - id: check-symlinks |
| 19 | + - id: mixed-line-ending |
| 20 | + - id: name-tests-test |
| 21 | + args: [--pytest-test-first] |
| 22 | + # pygrep-hooks: a collection of fast, cheap, regex based pre-commit hooks |
| 23 | + - repo: https://github.com/pre-commit/pygrep-hooks |
| 24 | + rev: v1.10.0 |
| 25 | + hooks: |
| 26 | + - id: python-no-log-warn |
| 27 | + - id: python-no-eval |
| 28 | + exclude: ^src/few_shot_utils/(train|evaluate)\.py$ |
| 29 | + - id: rst-directive-colons |
| 30 | + - id: rst-inline-touching-normal |
| 31 | + # check-manifest: This makes sense only if you have MANIFEST.in (TODO:review) |
| 32 | + - repo: https://github.com/mgedmin/check-manifest |
| 33 | + rev: "0.47" |
| 34 | + hooks: |
| 35 | + - id: check-manifest |
| 36 | + stages: [manual] |
| 37 | + # pip audit to check for known pip vulnerabilities, supports pyproject.toml |
| 38 | + - repo: https://github.com/pypa/pip-audit |
| 39 | + rev: v2.7.1 |
| 40 | + hooks: |
| 41 | + - id: pip-audit |
| 42 | + #Ruff linter and formatter |
| 43 | + - repo: https://github.com/astral-sh/ruff-pre-commit |
| 44 | + rev: v0.8.2 |
| 45 | + hooks: |
| 46 | + # Recommended to run linter first of automatic fixes are enabled (as some linting fixes might require reformatting) |
| 47 | + - id: ruff |
| 48 | + #Automatic linting fixes |
| 49 | + types_or: [ python, pyi, jupyter ] |
| 50 | + args: [ --fix ] |
| 51 | + - id: ruff-format |
| 52 | + types_or: [ python, pyi, jupyter ] |
0 commit comments