-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
113 lines (102 loc) · 4.84 KB
/
.pre-commit-config.yaml
File metadata and controls
113 lines (102 loc) · 4.84 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# fail_fast: true
exclude: |
(?x)^(
.*/migrations/.*|
examples/.*|
src/esrt/_.*.py|
CHANGELOG.md
)$
repos:
### LOCAL
- repo: local
hooks:
- id: sh -c
name: sh -c
entry: sh -c
args:
- echo "pre-commit!"
language: system
require_serial: true
# verbose: true
### PYTHON
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: f298305809c552671cc47e0fec0ba43e96c146a2 # frozen: v0.13.2
hooks: # https://beta.ruff.rs/docs/installation-and-usage/#usage
- id: ruff
args:
- --fix
- id: ruff-format
- repo: https://github.com/pre-commit/pygrep-hooks
rev: 3a6eb0fadf60b3cccfd80bad9dbb6fae7e47b316 # frozen: v1.10.0
hooks:
- id: python-check-blanket-noqa
- id: python-no-eval
- id: python-no-log-warn
- id: python-use-type-annotations
- id: text-unicode-replacement-char
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "8a22e281b3f6d1bb298aaabfc165a943a943882c" # frozen: v2.7.0
hooks:
- id: pyproject-fmt
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "9f70dc58c23dfcca1b97af99eaeee3140a807c7e" # frozen: v1.18.2
hooks:
- id: mypy
args:
- --explicit-package-bases
### MISC
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: 19b28a9f0a0102b30776f054bea4176e7af50dbe # frozen: v2.15.0
hooks:
- id: pretty-format-yaml
args:
- --offset=2
- --preserve-quotes
- --autofix
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
hooks: # https://pre-commit.com/hooks.html
# `(\S) - ` -> `$1 # `
- id: check-added-large-files # prevents giant files from being committed.
- id: check-ast # simply checks whether the files parse as valid python.
- id: check-builtin-literals # requires literal syntax when initializing empty or zero python builtin types.
- id: check-case-conflict # checks for files that would conflict in case-insensitive filesystems.
# - id: check-docstring-first # checks a common error of defining a docstring after code.
- id: check-executables-have-shebangs # ensures that (non-binary) executables have a shebang.
- id: check-json # checks json files for parseable syntax.
- id: check-shebang-scripts-are-executable # ensures that (non-binary) files with a shebang are executable.
- id: pretty-format-json # sets a standard for formatting json files.
args:
- --autofix
- --indent=2
- --no-sort-keys
- --no-ensure-ascii
- id: check-merge-conflict # checks for files that contain merge conflict strings.
# - id: check-symlinks # checks for symlinks which do not point to anything.
- id: check-toml # checks toml files for parseable syntax.
- id: check-vcs-permalinks # ensures that links to vcs websites are permalinks.
# - id: check-xml # checks xml files for parseable syntax.
- id: check-yaml # checks yaml files for parseable syntax.
args:
- --allow-multiple-documents
exclude: mkdocs.yml
- id: debug-statements # checks for debugger imports and py37+ `breakpoint()` calls in python source.
# - id: destroyed-symlinks # detects symlinks which are changed to regular files with a content of a path which that symlink was pointing to.
# - id: detect-aws-credentials # detects *your* aws credentials from the aws cli credentials file.
- id: detect-private-key # detects the presence of private keys.
- id: double-quote-string-fixer # replaces double quoted strings with single quoted strings.
- id: end-of-file-fixer # ensures that a file is either empty, or ends with one newline.
exclude: package.json
# - id: file-contents-sorter # sorts the lines in specified files (defaults to alphabetical). you must provide list of target files as input in your .pre-commit-config.yaml file.
- id: fix-byte-order-marker # removes utf-8 byte order marker.
# - id: fix-encoding-pragma # adds # -*- coding: utf-8 -*- to the top of python files.
# - id: forbid-new-submodules # prevents addition of new git submodules.
# - id: forbid-submodules # forbids any submodules in the repository
- id: mixed-line-ending # replaces or checks mixed line ending.
- id: name-tests-test # verifies that test files are named correctly.
args:
- --pytest-test-first
# - id: no-commit-to-branch # don't commit to branch
# - id: requirements-txt-fixer # sorts entries in requirements.txt.
# - id: sort-simple-yaml # sorts simple yaml files which consist only of top-level keys, preserving comments and blocks.
- id: trailing-whitespace # trims trailing whitespace.