-
Notifications
You must be signed in to change notification settings - Fork 34
/
.pre-commit-config.yaml
106 lines (98 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
99
100
101
102
103
104
105
106
# 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]
# Makes sure files end in a newline and only a newline;
- id: end-of-file-fixer
# Attempts to load all TOML files to verify syntax.
- id: check-toml
# Attempts to load all yaml files to verify syntax; unsafe: only check syntax, do not load yaml
- id: check-yaml
args: ["--unsafe"]
# Check for symlinks that do not point to anything.
- id: check-symlinks
# 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
# Prevent addition of new git submodules.
- id: forbid-new-submodules
# Prevent committing directly to trunk (since Bitbucket wants us to pay for this feature)
- id: no-commit-to-branch
args: ["--branch=main"]
# Detects the presence of private keys
- id: detect-private-key
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.261"
hooks:
- id: ruff
args: [--exit-non-zero-on-fix, --config=./pyproject.toml]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.2.0"
hooks:
- id: mypy
args:
[
--no-strict-optional,
--ignore-missing-imports,
--config-file=./pyproject.toml,
]
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
args:
- --config=./pyproject.toml
- repo: https://github.com/PyCQA/pylint
rev: v2.16.3
hooks:
- id: pylint
args:
- --rcfile=./pyproject.toml
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
args:
- --toml-config=./pyproject.toml
additional_dependencies:
- radon
- flake8-docstrings
- Flake8-pyproject
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args:
- --settings-path=./pyproject.toml
- repo: https://github.com/PyCQA/autoflake
rev: v2.0.1
hooks:
- id: autoflake
args:
- --in-place
- --remove-all-unused-imports
- --remove-unused-variable
- --ignore-init-module-imports