-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
50 lines (50 loc) · 1.57 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
# 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-case-conflict
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: local
hooks:
- id: poetry-check
name: Validate poetry config
entry: poetry check
language: python
pass_filenames: false
files: ^(.*/)?pyproject\.toml$
- id: poetry-lock
name: Update poetry lock file
entry: poetry lock
language: python
pass_filenames: false
files: ^(.*/)?(poetry\.lock|pyproject\.toml)$
- id: poetry-install
name: Install dependencies from the poetry lock file
entry: poetry install --sync
language: python
pass_filenames: false
stages: [post-checkout, post-merge]
always_run: true
- id: format-python
name: Format Python code
language: system
types: [python]
entry: poetry run ruff format
- id: lint-python
name: Lint Python code
language: system
types: [python]
entry: poetry run ruff check
args: [--fix, --unsafe-fixes]
- id: update-requirements
name: Update requirements.txt
language: system
files: poetry.lock
entry: poetry export --with=dev --output docker/requirements.txt
pass_filenames: false