-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
.pre-commit-config.yaml
27 lines (26 loc) · 1.39 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
repos:
# a set of useful Python-based pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
# list of definitions and supported hooks: https://pre-commit.com/hooks.html
- id: trailing-whitespace # removes any whitespace at the ends of lines
- id: check-toml # check toml syntax by loading all toml files
- id: check-yaml # check yaml syntax by loading all yaml files
- id: check-json # check-json syntax by loading all json files
- id: check-merge-conflict # check for files with merge conflict strings
args: ['--assume-in-merge'] # and run this check even when not explicitly in a merge
- id: check-added-large-files # check that no "large" files have been added
args: ['--maxkb=11240'] # where large means 10MB+, as in Hugging Face's git server
- id: debug-statements # check for python debug statements (import pdb, breakpoint, etc.)
- id: detect-private-key # checks for private keys (BEGIN X PRIVATE KEY, etc.)
- id: requirements-txt-fixer # formats requirement.txt files
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.2.2
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format