This repository has been archived by the owner on Aug 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
76 lines (75 loc) · 2.33 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
---
default_stages: [commit]
default_language_version:
python: python3.11
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
exclude: "(.+|^)requirements.txt" # poetry export modifies again so this line fails
- id: requirements-txt-fixer
- id: check-yaml
- id: check-toml
- id: check-ast
- id: check-builtin-literals
- id: check-executables-have-shebangs
- id: check-merge-conflict
- repo: https://github.com/python-poetry/poetry
rev: "1.3.0"
hooks:
- id: poetry-check
- id: poetry-lock
- id: poetry-export
name: poetry export dev-requirements.txt
args:
[
"-f",
"requirements.txt",
"-o",
"dev-requirements.txt",
"--only",
"dev",
"--without-hashes",
]
verbose: true
- id: poetry-export
name: poetry export requirements.txt
args:
[
"-f",
"requirements.txt",
"-o",
"requirements.txt",
"--without",
"dev",
"--without-hashes",
]
verbose: true
- repo: local
hooks:
- id: black
name: black - check formatting (show diff on FAIL)
entry: black
language: python
types: [python]
args: [--config, pyproject.toml, --check, --diff, --color, --quiet]
- id: black
name: black - auto-format code on FAIL
entry: black
language: python
types: [python]
args: [--config, pyproject.toml]
- id: isort
name: isort - import sorting
entry: isort
language: python
types: [python]
args: [--settings-path, pyproject.toml]
- id: flake8
name: flake8 - code lint and style checks
entry: flake8
language: python
types: [python]
args: [--config, .flake8]