Skip to content

Commit

Permalink
add python stuff for precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Feb 1, 2022
1 parent 0034710 commit 7769989
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,27 @@ repos:
- id: terraform_tflint
args: [ "--args=--config=__GIT_WORKING_DIR__/.tflint.hcl"]
exclude: examples/

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: check-symlinks
- id: detect-aws-credentials
- id: detect-private-key

- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v1.6.0
hooks:
- id: autopep8

# https://ljvmiranda921.github.io/notebook/2018/06/21/precommits-using-black-and-flake8/
## - repo: https://github.com/ambv/black
## rev: stable
## hooks:
## - id: black
## # language_version: python3.6
## language_version: python3
##- repo: https://gitlab.com/pycqa/flake8
## rev: 3.7.9
## hooks:
## - id: flake8
35 changes: 35 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[tool.black]
line-length = 79
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
'''

[tool.autopep8]
max-line-length = 88
indent_size = 4
ignore="E902,E111"
# ignore = "E226,E302,E41"

# ## in vim
# ## :%! autopep8 -
# [pycodestyle]
# indent-size = 2
# #max-line-length = 100
# #ignore = E226,E302,E41

[tool.flake8]
ignore = "E203, E266, E501, W503, F403, F401, E722, E902, E111"
max-line-length = 79
max-complexity = 18
select = "B,C,E,F,W,T4,B9"

0 comments on commit 7769989

Please sign in to comment.