-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.pre-commit-config.yaml
97 lines (88 loc) · 2.97 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
## Pre-commit setup
repos:
# its possible to put this at the bottom, but we want the pre-commit-hooks to check these files as well.
- repo: local
hooks:
- id: ensure-default-configuration-is-exported
name: Export default configuration
language: python
entry: poetry run python -m scripts.export_new_config_to_default_config
files: '(app\.json|template\.env|modmail\/(config\.py|default_config(\.toml|\.yaml)))$'
require_serial: true
additional_dependencies:
- atoml
- attrs
- click
- coloredlogs
- desert
- https://github.com/Rapptz/discord.py/archive/45d498c1b76deaf3b394d17ccf56112fa691d160.zip
- marshmallow
- python-dotenv
- pyyaml
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-case-conflict
- id: check-added-large-files
- id: check-json
- id: check-toml
- id: check-yaml
exclude: 'mkdocs.yml' # Exclude all mkdocs.yml as they use tags i.e. `!!!`
- id: pretty-format-json
exclude: 'app.json'
args: [--indent=4, --autofix]
- id: end-of-file-fixer
- id: no-commit-to-branch
name: protect-branch
alias: protect-branch
args: [--branch=main, --branch=master]
- id: mixed-line-ending
args: [--fix=lf]
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa
- id: python-check-blanket-type-ignore
- id: python-use-type-annotations
- repo: https://github.com/python-poetry/poetry
rev: 1.8.0
hooks:
- id: poetry-check
name: Check poetry.lock is up to date
- repo: https://github.com/python-poetry/poetry-plugin-export
rev: 1.8.0
hooks:
- id: poetry-export
name: Generate requirements.txt
args: ['-qqq', -f, requirements.txt, --without-hashes, --output, requirements.txt]
files: '(pyproject.toml|poetry.lock|requirements.txt)$'
- id: poetry-export
name: Generate docs requirements.txt
args: ['-qqq', --only, docs, -f, constraints.txt, --without-hashes, --output, docs/.requirements.txt]
files: '(pyproject.toml|poetry.lock|docs\/.requirements.txt)$'
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/asottile/blacken-docs
rev: 1.18.0
hooks:
- id: blacken-docs
additional_dependencies:
- black
- repo: https://github.com/psf/black
rev: 24.8.0
hooks:
- id: black
language_version: python3
- repo: local
hooks:
- id: flake8
name: flake8
description: '`flake8` is a command-line utility for enforcing style consistency across Python projects.'
entry: poetry run flake8
language: python
types: [python]
require_serial: true