-
Notifications
You must be signed in to change notification settings - Fork 1
/
.pre-commit-config.yaml
76 lines (72 loc) · 2.84 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
# 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.6.0
hooks:
- id: check-added-large-files
# 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/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.4
hooks:
# Run the linter.
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --config=./pyproject.toml]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.10.0"
hooks:
- id: mypy
args:
[
--no-strict-optional,
--ignore-missing-imports,
--config-file=./pyproject.toml,
]
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
args:
- --config=./pyproject.toml