-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
108 lines (97 loc) · 3 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
---
repos:
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
- id: detect-secrets
exclude: ".pre-commit-config.yaml|infrastructure/localstack/provider.tf|src/etl/sds/tests/changelog"
- repo: https://github.com/prettier/pre-commit
rev: 57f39166b5a5a504d6808b87ab98d41ebf095b46
hooks:
- id: prettier
exclude: "CHANGELOG.md"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-yaml
- id: check-toml
- id: check-json
- id: check-merge-conflict
- id: end-of-file-fixer
- id: trailing-whitespace
- id: no-commit-to-branch
name: Prevent commits to dev / master
entry: no-commit-to-branch
language: python
args: [-b, develop, -b, master, -b, main]
pass_filenames: false
# Flake8 for print only (error code T201)
- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
- id: flake8
additional_dependencies:
- flake8-print
args:
- "--select=T201,F401,F402,F403"
- "--exclude=.git,__pycache__,dist,.venv,scripts,scripts/changelog/changelog_precommit.py,src/layers/domain/core/device/__init__.py,src/layers/domain/core/device_key/__init__.py"
# Flake8 for asserts (error code S101)
- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
- id: flake8
args:
- "--select=S101"
- "--exclude=.git,__pycache__,dist,.venv,tests"
- repo: https://github.com/psf/black
rev: 24.8.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args:
[
--profile,
black,
--filter-files,
--project=nrlf,
--project=helpers,
--project=layer,
]
- repo: https://github.com/ducminh-phan/reformat-gherkin
rev: v3.0.1
hooks:
- id: reformat-gherkin
# This uses the root .terraform-version file, make sure to update it you change the actual terraform versions
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.76.0
hooks:
- id: terraform_fmt
args:
- --args=-write=true
- --args=-recursive
- repo: local
hooks:
- id: forbid_client_dynamodb
name: Don't use boto3.client("dynamodb") - use dynamodb_client() instead
entry: boto3\.client\(\"dynamodb\"\)
language: pygrep
types: [python]
exclude: src/layers/event/aws/client.py
- repo: local
hooks:
- id: forbid_json_load
name: Don't use json.load(s) - use json_load(s) instead
entry: \ json\.load
language: pygrep
types: [python]
exclude: src/layers/event/json/__init__.py
- repo: local
hooks:
- id: create_changelog
name: Create changelog from changelog files
entry: scripts/changelog/changelog-precommit.sh
language: python