-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
98 lines (91 loc) · 3.49 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
# Fails if there are any ">>>>>" lines in files due to merge conflicts.
- id: check-merge-conflict
# Trims trailing whitespace. Allow a single space on the end of .md lines for hard line breaks.
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
exclude: '^ruff_mypy/'
# Makes sure files end in a newline and only a newline;
- id: end-of-file-fixer
exclude: '^ruff_mypy/'
# Attempts to load all TOML files to verify syntax.
- id: check-toml
exclude: '^ruff_mypy/'
# Attempts to load all yaml files to verify syntax; unsafe: only check syntax, do not load yaml
- id: check-yaml
args: ["--unsafe"]
exclude: '^ruff_mypy/'
# Check for symlinks that do not point to anything.
- id: check-symlinks
exclude: '^ruff_mypy/'
# Fail if staged files are above a certain size.
# To add a large file, use 'git lfs track <file>; git add <file> to track large files with
# git-lfs rather than commiting them directly to the git history
- id: check-added-large-files
args: ["--maxkb=500"]
# HALT! Before you exclude a large file and commit it, forever
# bloating our repo size, did you:
# (1) use a CLI tool like imageoptim to compress them if they are images
# (2) think hard about whether using DVC or git-lfs is more appropriate
# for the file--such as in the case of CSV files or other data
# This can be confusing. Reach out for help in our chat to help decide
# how to deal adding these large files you have :)
exclude: |
(?x)(
^example/large/file.csv|
^example/large/sklearn-model.pkl
)
# Sort requirements in requirements.txt files.
- id: requirements-txt-fixer
exclude: '^ruff_mypy/'
# Prevent addition of new git submodules.
- id: forbid-new-submodules
exclude: '^ruff_mypy/'
# Prevent committing directly to trunk (since Bitbucket wants us to pay for this feature)
- id: no-commit-to-branch
args: ["--branch=main"]
exclude: '^ruff_mypy/'
# Detects the presence of private keys
- id: detect-private-key
# args: ['.env']
- repo: https://github.com/PyCQA/pylint
rev: v3.0.0a6
hooks:
- id: pylint
args: [--rcfile=pyproject.toml]
exclude: '^ruff_mypy/'
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.261"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --config=pyproject.toml]
exclude: '^ruff_mypy/'
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
args: [--settings=pyproject.toml]
exclude: '^ruff_mypy/'
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.2.0"
hooks:
- id: mypy
args: [--no-strict-optional, --ignore-missing-imports]
exclude: '^ruff_mypy/'
- repo: https://github.com/pycqa/flake8
rev: "7.0.0" # pick a git hash / tag to point to
hooks:
- id: flake8
entry: pflake8
additional_dependencies:
- pyproject-flake8
- radon
- flake8-docstrings
args: [--config=pyproject.toml]
exclude: '^ruff_mypy/'