Skip to content

Commit 676ff4f

Browse files
committed
Add precommit hook to run checks
1 parent 5201220 commit 676ff4f

9 files changed

+90
-0
lines changed

.bandit

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[bandit]
2+
skips = B701

.editorconfig

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
trim_trailing_whitespace = true
7+
8+
[*.py]
9+
indent_style = space
10+
indent_size = 4
11+
12+
[**.yml]
13+
indent_style = space
14+
indent_size = 2

.flake8

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
max-line-length = 88
3+
4+
select = C,E,F,W,B,B950
5+
extend-ignore = E203, E501, W503

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ build/
33
.vscode/c_cpp_properties.json
44
.DS_Store
55

6+
**/*.pyc

.isort.cfg

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[settings]
2+
profile=black

.mypy.ini

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[mypy]
2+
3+
exclude = venv
4+
5+
; [mypy-utils.*]
6+
; ignore_missing_imports = True
7+
; ignore_errors = True

.pre-commit-config.yaml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
default_language_version:
2+
python: python3
3+
4+
repos:
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v4.4.0
7+
hooks:
8+
- id: check-yaml
9+
- id: end-of-file-fixer
10+
- id: trailing-whitespace
11+
- repo: https://github.com/psf/black
12+
rev: 23.3.0
13+
hooks:
14+
- id: black
15+
- repo: https://github.com/pycqa/isort
16+
rev: 5.12.0
17+
hooks:
18+
- id: isort
19+
- repo: https://github.com/PyCQA/flake8
20+
rev: 6.0.0
21+
hooks:
22+
- id: flake8
23+
- repo: https://github.com/PyCQA/pylint
24+
rev: v2.17.4
25+
hooks:
26+
- id: pylint
27+
- repo: https://github.com/pre-commit/mirrors-mypy
28+
rev: v1.3.0
29+
hooks:
30+
- id: mypy
31+
additional_dependencies:
32+
[
33+
'types-PyYAML',
34+
]
35+
- repo: https://github.com/PyCQA/bandit
36+
rev: 1.7.5
37+
hooks:
38+
- id: bandit
39+
args: [
40+
'--ini',
41+
'.bandit',
42+
]

.pylintrc

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[MASTER]
2+
init-hook="from pylint.config import find_pylintrc; import os, sys; sys.path.append(os.path.dirname(find_pylintrc()))"
3+
4+
[TYPECHECK]
5+
6+
# List of members which are set dynamically and missed by Pylint inference
7+
# system, and so shouldn't trigger E1101 when accessed.
8+
# generated-members=xxx.*
9+
10+
11+
[pylint.messages_control]
12+
disable=missing-function-docstring, line-too-long, import-error,
13+
too-many-arguments, too-many-locals, too-many-statements, too-many-branches, too-few-public-methods,
14+
too-many-instance-attributes, fixme, import-outside-toplevel, logging-fstring-interpolation,

codegen/requirements-dev.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pre-commit
2+
black
3+
mypy

0 commit comments

Comments
 (0)