forked from brettcs/dtrx
-
Notifications
You must be signed in to change notification settings - Fork 10
/
.pre-commit-config.yaml
114 lines (102 loc) · 3.89 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: web/
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files # prevents giant files from being committed.
- id: check-case-conflict # checks for files that would conflict in case-insensitive filesystems.
- 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: 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-vcs-permalinks # ensures that links to vcs websites are permalinks.
- id: check-yaml # checks yaml files for parseable syntax.
- 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-private-key # detects the presence of private keys.
exclude: tools/crx-example/getting-started\.pem
- id: end-of-file-fixer # ensures that a file is either empty, or ends with one newline.
exclude: |
(?x)^(
^tools/crx-example/.*
)$
- 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: mixed-line-ending # replaces or checks mixed line ending.
- id: pretty-format-json # This hook sets a standard for formatting JSON files.
exclude: |
(?x)^(
^\.vscode/.*|
^tools/crx-example/.*
)$
- id: requirements-txt-fixer # sorts entries in requirements.txt.
- id: trailing-whitespace # trims trailing whitespace.
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
args: [--profile=black]
files: (dtrx)|(\.(py)$)
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.22.0
hooks:
- id: check-github-actions
- id: check-github-workflows
# keep this in front of prettier, in case they're incompatible
- repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs
rev: v1.1.2
hooks:
- id: markdown-toc
args: [--no-firsth1, -i, --bullets=-]
require_serial: true
# only apply this to the top-level README.md
files: \./README\.md
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.9-for-vscode
hooks:
- id: prettier
args: [--write]
files: \.(js|ts|jsx|tsx|css|less|html|json|markdown|md|yaml|yml)$
exclude: |
(?x)^(
^\.vscode/.*|
^tools/crx-example/.*
)$
- repo: https://github.com/hadolint/hadolint
rev: v2.12.1-beta
hooks:
- id: hadolint-docker
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies: [flake8-bugbear]
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.9.0
hooks:
- id: shellcheck
files: \.sh$
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.2.0
hooks:
- id: setup-cfg-fmt
- repo: local
hooks:
# pylint needs to run from local python environment, so it can check
# imported packages
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
exclude: |
(?x)^(
^tests/.*|
^dtrx/dtrx.py
)$