From 205871c75a7f7b59e98c97741bc0347df2a88b56 Mon Sep 17 00:00:00 2001 From: Shubhank Saxena Date: Fri, 28 Feb 2020 20:09:18 +0530 Subject: [PATCH] Add pre-commit flake8/isort checks (#6058) After setting up the pre-commit hooks you will get `flake8` and `isort` checks. Co-authored-by: Armen Zambrano --- .pre-commit-config.yaml | 9 +++++++++ docs/installation.md | 8 ++++++++ 2 files changed, 17 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..2d0daeedc --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,9 @@ +repos: + - repo: https://gitlab.com/pycqa/flake8 + rev: 3.7.9 + hooks: + - id: flake8 + - repo: https://github.com/timothycrosley/isort + rev: 4.3.21 + hooks: + - id: isort diff --git a/docs/installation.md b/docs/installation.md index 51c50aa03..7efbaea09 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -12,6 +12,14 @@ If you only want to hack on the frontend, see the UI Development section below. Before pushing new code, please make sure you are following our [Code Style](code_style.md#ui) and [Accessibility Guidelines](accessibility.md). +- If you would like pre-commit linting checks you can set it up like this: + ```console + % pip install pre-commit + % pre-commit install + pre-commit installed at .git/hooks/pre-commit + ```` + From here on, linting checks will be executed every time you commit. + ## UI Development To get started: