-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
41 lines (38 loc) · 1.25 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
39
40
41
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-json
- id: check-yaml # doesn't work with includes
args: [--allow-multiple-documents, --unsafe]
- id: check-toml
- id: check-added-large-files
- id: debug-statements
- id: mixed-line-ending
- id: check-merge-conflict
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: no-commit-to-branch # protects from committing directly to main
# Run ruff to very quickly catch syntax errors and do autofixes
- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: 'v0.0.277'
hooks:
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]
# Run black to enforce a global code style
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.1
hooks:
- id: insert-license
name: "Insert license header in python source files"
args: [--license-filepath=license_header.txt,
'--comment-style=#',
--detect-license-in-X-top-lines=16]
types_or: [python]