From aecc87b2ae476b39a11fa4d20ad8080fce2d1605 Mon Sep 17 00:00:00 2001 From: Natalia Maximo Date: Tue, 6 Jul 2021 15:56:52 -0400 Subject: [PATCH] new: added pre-commit dev tool (#20) --- .pre-commit-config.yaml | 22 ++++++++++++++++++++++ Makefile | 4 ++-- 2 files changed, 24 insertions(+), 2 deletions(-) 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..a5a4cb6 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,22 @@ +repos: + - repo: https://gitlab.com/pycqa/flake8 + rev: '3.8.3' + hooks: + - id: flake8 + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.1.0 + hooks: + - id: check-ast + - id: check-case-conflict + - id: check-docstring-first + - id: check-merge-conflict + - id: check-executables-have-shebangs + - id: check-json + - id: pretty-format-json + - id: debug-statements + - id: detect-private-key + - id: double-quote-string-fixer + - id: end-of-file-fixer + - id: fix-encoding-pragma + - id: name-tests-test + - id: trailing-whitespace diff --git a/Makefile b/Makefile index 1f7661d..299b84c 100644 --- a/Makefile +++ b/Makefile @@ -67,5 +67,5 @@ install-tests: ## Install the package and test dependencies $(PYTHON_EXECUTABLE) -m pip install -e .[tests] .PHONY: install-all -install-all: ## Install the package, docs, and test dependencies - $(PYTHON_EXECUTABLE) -m pip install -e .[all] +install-all: ## Install the package, docs, and test dependencies as well as pre-commit hooks + $(PYTHON_EXECUTABLE) -m pip install -e .[all] && pre-commit install