-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
72 lines (67 loc) · 2.19 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
# pre-commit stop running hooks after the first failure.
fail_fast: true
# A list of repository mappings
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
# Specify version or tag to use (as of 24.2.24)
rev: v4.6.0
hooks:
# Remove spaces at end of lines except markdown
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
# Make the last line of the file a newline code
- id: end-of-file-fixer
# Unify line break code to LF
- id: mixed-line-ending
args: [--fix=lf]
# toml syntax check
- id: check-toml
# yaml syntax check
- id: check-yaml
# https://python-poetry.org/docs/pre-commit-hooks/#usage
- repo: https://github.com/python-poetry/poetry
# Cannot be executed with local designation (as of 23.5.31)
rev: 1.8.3
hooks:
- id: poetry-check
verbose: true
- id: poetry-lock
verbose: true
- id: poetry-export
args: ["-f", "requirements.txt", "-o", "requirements.txt", "--without-hashes"]
verbose: true
files: ^pyproject\.toml$
- id: poetry-export
args: ["--with", "dev", "-f", "requirements.txt", "-o", "requirements-dev.txt", "--without-hashes"]
verbose: true
files: ^pyproject\.toml$
# Reference: https://github.com/DavidAnson/markdownlint-cli2#overview
# > markdownlint-cli is a traditional command-line interface for markdownlint.
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.41.0
hooks:
- id: markdownlint
args: ["--config", ".markdownlint.json", "README.md"]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.6.4
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format
# Repository local hooks
- repo: local
hooks:
- id: mypy
name: mypy
stages: [commit]
language: system
entry: poetry run mypy
types: [python]
# Original script
#- id: update-pyproject
# name: Update pyproject.toml version
# entry: poetry run python ci/update_pyproject_version.py
# language: system
# pass_filenames: false
# stages: [commit]
# additional_dependencies: []