diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4e10255..9675dae 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..13aa721 --- /dev/null +++ b/pyproject.toml @@ -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"