diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..a2937df --- /dev/null +++ b/.flake8 @@ -0,0 +1,15 @@ +[flake8] +max-line-length = 88 +ignore = E501, E203, W503 +per-file-ignores = __init__.py:F401 +exclude = + .git + __pycache__ + dist + vendor + .venv + .tox + .pytest_cache + .github + _legacy + _internal \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..6789aa1 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,25 @@ +repos: + - repo: https://github.com/psf/black + rev: 19.10b0 + hooks: + - id: black + exclude: &exclude | + (?x)( + ^src/gnmi/proto/_internal/.* + | ^src/gnmi/proto/_legacy/.* + ) + + - repo: https://gitlab.com/pycqa/flake8 + rev: 3.8.3 + hooks: + - id: flake8 + exclude: *exclude + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.1.0 + hooks: + - id: trailing-whitespace + exclude: *exclude + - id: end-of-file-fixer + exclude: *exclude + - id: debug-statements