-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
31 lines (29 loc) · 943 Bytes
/
.pre-commit-config.yaml
File metadata and controls
31 lines (29 loc) · 943 Bytes
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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
exclude: ^(infra/|\.dvc/|\.gitignore|README\.md|.*\.lock$)
- id: end-of-file-fixer
exclude: ^(infra/|\.dvc/|.*\.lock$)
- id: check-yaml
- id: check-added-large-files
- id: check-merge-conflict
- id: debug-statements
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.12.7
hooks:
# Run the linter.
- id: ruff-check
args: [--fix]
# Run the formatter.
- id: ruff-format
- repo: local
hooks:
- id: no-commit-to-branch
name: Don't commit to main branch
entry: bash -c 'if [[ "$(git rev-parse --abbrev-ref HEAD)" == "main" ]]; then echo "Direct commits to main branch are not allowed"; exit 1; fi'
language: system
pass_filenames: false
always_run: true