From 1b8c2a0166a27d55cfd383f1660d421065242f69 Mon Sep 17 00:00:00 2001 From: Ned Webster Date: Mon, 8 Nov 2021 13:56:51 +0000 Subject: [PATCH 1/3] removed old pre-commit file --- .githooks/pre-commit | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .githooks/pre-commit diff --git a/.githooks/pre-commit b/.githooks/pre-commit deleted file mode 100644 index 29b97a1..0000000 --- a/.githooks/pre-commit +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -# to activate this git pre commit file run the following command; -# git config core.hooksPath .githooks - -# get added and modified python files -for file in $(git diff --cached --name-only --diff-filter=AM | grep -E '\.(py)$') - -# run black -do - black "$file" - - $(git add "$file") - - done - - From 4f3a1b1b9aaa72e97fe59e2f0991f5b7b90385fb Mon Sep 17 00:00:00 2001 From: Ned Webster Date: Mon, 8 Nov 2021 14:07:38 +0000 Subject: [PATCH 2/3] added pre-commit package to dev requirements --- requirements-dev.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements-dev.txt b/requirements-dev.txt index 58e67f2..10d78d6 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,6 +3,7 @@ pytest>=5.4.1 pytest-mock>=3.0.0 pytest-cov>=2.10.1 pytest-benchmark +pre-commit==2.15.0 black>=19.10b0 flake8==3.8.4 bandit>=1.7.0 \ No newline at end of file From 5b093e3c4abc1d7057afd23e650734dbf42adc40 Mon Sep 17 00:00:00 2001 From: Ned Webster Date: Mon, 8 Nov 2021 14:08:04 +0000 Subject: [PATCH 3/3] Added pre-commit-config.yaml file --- .pre-commit-config.yaml | 9 +++++++++ 1 file changed, 9 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 0000000..2f763ea --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,9 @@ +repos: +- repo: https://github.com/psf/black + rev: 19.3b0 + hooks: + - id: black +- repo: https://github.com/PyCQA/flake8 + rev: 3.9.2 + hooks: + - id: flake8 \ No newline at end of file