forked from timesler/facenet-pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
82 lines (78 loc) · 2.56 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
77
78
79
80
81
82
# can be used to exclude certain regex patterns or paths
exclude: '^$'
# if set to true, fails on first failure
fail_fast: false
repos:
# The following pre-commit hooks could be very useful.
# They are not part of CI/CD, so use or remove them as you please
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: debug-statements
- id: name-tests-test
args: [
"--pytest-test-first" # test_.*\.py
#"--pytest" # .*_test\.py
#"--unittest" # test.*\.py
]
- id: check-added-large-files
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-merge-conflict
- id: check-yaml
args: ['--unsafe']
- id: check-toml
- id: check-xml
- id: detect-private-key
- repo: https://gitlab.com/bmares/check-json5
rev: v1.0.0
hooks:
- id: check-json5
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.13.0
hooks:
- id: markdownlint-cli2
args: [ "--fix", "--config", ".markdownlint.yaml" ]
# part of CI/CD
- repo: local
hooks:
- id: poetry-check
name: poetry-check --lock
description: run poetry check to validate config
entry: poetry check --lock
language: python
pass_filenames: false
files: ^(.*/)?pyproject\.toml$
# - id: poetry-export
# name: poetry-export
# description: run poetry export to sync lock file with requirements.txt
# entry: poetry export
# language: python
# pass_filenames: false
# files: ^(.*/)?poetry\.lock$
# args: ["-f", "requirements.txt", "-o", "requirements.txt"]
# - id: poetry-export-dev
# name: poetry-export --with-dev
# description: run poetry export to sync lock file with requirements.txt
# entry: poetry export
# language: python
# pass_filenames: false
# files: ^(.*/)?poetry\.lock$
# args: ["--with", "dev", "-f", "requirements.txt", "-o", "requirements-dev.txt"]
- id: ruff-format
name: ruff-format
description: "Run 'ruff format' for extremely fast Python formatting"
entry: ruff format --force-exclude
language: python
types_or: [python, pyi]
args: []
- id: ruff
name: ruff
description: Run 'ruff' for extremely fast Python linting
entry: ruff check --force-exclude
language: python
types_or: [python, pyi]
args: [--fix]