-
Notifications
You must be signed in to change notification settings - Fork 26
/
.pre-commit-config.yaml
38 lines (37 loc) · 1.71 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
# Test data is supposed to be verbatim, including errors. Exclude it from linting.
exclude: tests/integration/data
repos:
# Normalise all Python code. (Black + isort + pyupgrade + autoflake)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.2
hooks:
- id: ruff
args: [--fix, --show-fixes, --output-format, grouped]
exclude: '_version.py|versioneer.py'
- id: ruff-format
# Common Python security checks. (this is complementary to dlint in flake8)
- repo: https://github.com/PyCQA/bandit
rev: '1.8.0'
hooks:
- id: bandit
exclude: '^tests/|_version.py|versioneer.py'
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files # We don't want huge files. (Cut down test data!)
args: ['--maxkb=3000']
- id: check-case-conflict # Don't allow files that differ by case sensitivity.
- id: check-docstring-first # Avoid common error of code before docstring.
- id: check-json # Check json file syntax
- id: check-merge-conflict
- id: check-symlinks # Symlinks that don't point to anything?
- id: check-yaml # Check Yaml file syntax
- id: debug-statements # Avoid commiting debug/breakpoints
- id: end-of-file-fixer # Normalise on exactly one newline
- id: fix-byte-order-marker # No UTF-8 byte order marks
- id: mixed-line-ending # Don't allow mixed line endings
- id: pretty-format-json
args: ['--no-sort-keys', '--indent=4', '--autofix']
- id: requirements-txt-fixer # Keep requirements files sorted.
- id: trailing-whitespace # Auto remove trailing whitespace