From b40e20e3e17b2f5c1c10fbe6a6c5510f1256b310 Mon Sep 17 00:00:00 2001 From: Arun Babu Neelicattu Date: Thu, 23 Jul 2020 02:43:05 +0200 Subject: [PATCH] Add linting configuration --- .flake8 | 15 +++++++++++++++ .pre-commit-config.yaml | 25 +++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .flake8 create mode 100644 .pre-commit-config.yaml 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