forked from aws/aws-iot-fleetwise-edge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
94 lines (94 loc) · 2.99 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_language_version:
# More recent versions are built against GLIBC_2.28+. We want to keep it compatible with
# Amazon Linux 2 (GLIBC_2.26)
node: "16.19.0"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=lf]
- id: check-added-large-files
- id: check-case-conflict
- id: check-json
- id: check-yaml
exclude: cfn-templates|public-ecr
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-merge-conflict
- id: check-vcs-permalinks
- id: debug-statements
- id: destroyed-symlinks
- id: detect-aws-credentials
args: [--allow-missing-credentials]
- id: detect-private-key
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v10.0.1
hooks:
- id: clang-format
- repo: https://github.com/PyCQA/autoflake
rev: v2.0.0
hooks:
- id: autoflake
name: autoflake
args:
[
"--in-place",
"--remove-unused-variables",
"--remove-all-unused-imports",
"--expand-star-imports",
]
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
args: [--safe]
- repo: https://github.com/asottile/blacken-docs
rev: v1.12.1
hooks:
- id: blacken-docs
additional_dependencies: [black==22.12.0]
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4 # Some plugins still require <6
hooks:
- id: flake8
additional_dependencies:
- flake8-implicit-str-concat==0.3.0
- pep8-naming==0.13.3
- flake8-bugbear==22.12.6
- flake8-broken-line==0.6.0
- flake8-comprehensions==3.10.1
- flake8-builtins==2.1.0
- flake8-pytest-style==1.6.0
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
- id: prettier
- repo: local
hooks:
- id: validate-static-config
name: validate-static-config
# pre-commit intentionally pass all files as args to the command.
# Since the json command only takes one file at once we need some shell script to split the args.
entry:
bash -c 'for x in "$@"; do echo "Validating file $x"; json validate --schema-file
interfaces/protobuf/schemas/edgeConfiguration/staticConfiguration.json --document-file
"$x"; done' --
language: python
files: "configuration/static-config.json"
types: [json]
additional_dependencies: ["json-spec==0.10.1"]
verbose: true