From 0f9301742afe5da8db0263431d4cc4ebe1ab1678 Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Sun, 17 May 2020 00:49:13 +0000 Subject: [PATCH] Add pre-commit hooks --- .pre-commit-config.yaml | 17 +++++++++++++++++ requirements_test.txt | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..d06a60d --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,17 @@ +repos: + - repo: https://github.com/psf/black + rev: 19.10b0 + hooks: + - id: black + args: + - --safe + - --quiet + files: ^((blinkpy|tests)/.+)?[^/]+\.py$ + - repo: https://gitlab.com/pycqa/flake8 + rev: 3.8.1 + hooks: + - id: flake8 + additional_dependencies: + - flake8-docstrings==1.5.0 + - pydocstyle==5.0.2 + files: ^(homeassistant|tests)/.+\.py$ diff --git a/requirements_test.txt b/requirements_test.txt index fb837be..1392b79 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -2,6 +2,7 @@ black==19.10b0 coverage==5.1 flake8==3.8.1 flake8-docstrings==1.5.0 +pre-commit==2.4.0 pylint==2.5.2 pydocstyle==5.0.2 pytest==5.4.1 @@ -9,4 +10,4 @@ pytest-cov==2.8.1 pytest-sugar==0.9.3 pytest-timeout==1.3.4 restructuredtext-lint==1.3.0 -pygments==2.6.1 \ No newline at end of file +pygments==2.6.1