-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
82 lines (75 loc) · 2.54 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
# 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
rev: v5.0.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
exclude: '^(requirements.txt|requirements-dev.txt)$'
# 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://github.com/shellcheck-py/shellcheck-py?tab=readme-ov-file#usage
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
- repo: https://github.com/rhysd/actionlint
rev: v1.7.6
hooks:
- id: actionlint
# https://python-poetry.org/docs/pre-commit-hooks/#usage
- repo: https://github.com/python-poetry/poetry
# Cannot be executed with local designation (as of 24.8.3)
rev: 2.0.0
hooks:
- id: poetry-check
verbose: true
- id: poetry-lock
verbose: true
- repo: local
hooks:
- id: poetry-export
name: Export requirements.txt
entry: poetry export -f requirements.txt -o requirements.txt --without-hashes
language: python
pass_filenames: false
additional_dependencies:
- "poetry"
- "poetry-plugin-export"
- id: poetry-export-dev
name: Export dev requirements.txt
entry: poetry export --with dev -f requirements.txt -o requirements-dev.txt --without-hashes
language: python
pass_filenames: false
additional_dependencies:
- "poetry"
- "poetry-plugin-export"
# 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.43.0
hooks:
- id: markdownlint
args: ["--config", ".markdownlint.json", "README.md"]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.9.1
hooks:
- id: ruff
args: ["--fix","repo_dispatch_event_sender"]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.1
hooks:
- id: mypy
additional_dependencies: [types-requests==2.32.0.20240622]
args: [--config-file=pyproject.toml]