-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
35 lines (32 loc) · 995 Bytes
/
Copy path.pre-commit-config.yaml
File metadata and controls
35 lines (32 loc) · 995 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
32
33
34
35
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.8 # Use the latest version
hooks:
- id: ruff-check
args: [ --fix ]
- id: ruff-format
- repo: local
hooks:
- id: no-commit-to-main
name: Prevent commits to main
entry: bash -c 'branch=$(git symbolic-ref HEAD 2>/dev/null | sed "s|refs/heads/||"); if [ "$branch" = "main" ]; then echo "❌ Direct commits to main are blocked. Create a branch first."; exit 1; fi'
language: system
pass_filenames: false
#- repo: local
# hooks:
# - id: pylint
# name: pylint
# entry: poetry run pylint
# language: system
# types: [python]
# args:
# [
# "-rn", # Only display messages
# "-sn", # Don't display the score
# "--rcfile=.pylintrc", # Use your pylint config file
# ]
- repo: https://github.com/python-poetry/poetry
rev: '2.1.4' # add version here
hooks:
- id: poetry-check
- id: poetry-lock