diff --git a/.bandit b/.bandit new file mode 100644 index 00000000..f46641c1 --- /dev/null +++ b/.bandit @@ -0,0 +1,2 @@ +[bandit] +skips = B101,B102,B105,B301,B303,B310,B318,B401,B403,B404,B405,B408,B314,B602,B603,B604,B606,B607 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..8d52b512 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,74 @@ +--- +files: + (?x)^( + .*/Makefile| + .*\.sh| + .*\.py| + .*\.yaml| + .*\.md + )$ +exclude: + (?x)^( + .*error.*\.yaml| + experiments/.* + )$ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.0.1 + hooks: + - id: no-commit-to-branch + args: [--branch, main] + - id: check-ast + - id: check-yaml + args: [--unsafe] + - id: debug-statements + - id: end-of-file-fixer + - id: trailing-whitespace + - id: check-json + - id: mixed-line-ending + - id: check-builtin-literals + - id: check-merge-conflict + - id: check-docstring-first + - id: fix-byte-order-marker + - id: check-case-conflict + - id: check-executables-have-shebangs + - id: check-shebang-scripts-are-executable + # - id: check-toml + - repo: https://github.com/adrienverge/yamllint.git + rev: v1.23.0 + hooks: + - id: yamllint + args: [--no-warnings] + - repo: https://github.com/asottile/pyupgrade + rev: v2.31.0 + hooks: + - id: pyupgrade + - repo: https://github.com/psf/black + rev: 22.1.0 + hooks: + - id: black + - repo: https://github.com/Lucas-C/pre-commit-hooks-bandit + rev: v1.0.5 + hooks: + - id: python-bandit-vulnerability-check + - repo: https://github.com/fsouza/autoflake8 + rev: v0.3.1 + hooks: + - id: autoflake8 + - repo: https://github.com/PyCQA/flake8 + rev: 3.9.2 + hooks: + - id: flake8 + - repo: https://github.com/PyCQA/isort + rev: 5.10.1 + hooks: + - id: isort + - repo: https://github.com/codespell-project/codespell + rev: v2.1.0 + hooks: + - id: codespell + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v0.931 + hooks: + - id: mypy + # TODO: mdformat --wrap 75 README.md --number diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..f6967220 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,45 @@ +[no-commit-to-branch] +branch = main + +[check-yaml] + +unsafe = True + +[pyupgrade] + +py36-plus = True + +[black] + +safe = True +quiet = True +line-length = 127 + +[autoflake8] +in-place = True +recursive = True +expand-star-imports = True + +[flake8] +ignore = E402, E226, E126, W504 +max-line-length = 127 +max-complexity = 21 +exclude = + experiments/kicad/v6/ + experiments/JLC/ + kibot/mcpyrate/ + submodules/ + +[codespell] +ignore-words-list=kibot,tht +quiet-level = 2 + +[mypy] +exclude = experiments build +ignore_missing_imports = True +# install_types = True +# non_interactive = True +check_untyped_defs = True +show_error_codes = True +show_error_context = True +# additional_dependencies = module==version