From ae1eb3fbc1db8b45f91cc74840284020b219ae6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eivind=20Sj=C3=B8vold?= Date: Mon, 22 Aug 2022 15:01:31 +0200 Subject: [PATCH] Add pre-commit hooks, black, mypy, pytest --- .pre-commit-config.yaml | 21 +++++++++++++++++++++ setup.py | 2 +- 2 files changed, 22 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..526557a --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,21 @@ +repos: + - repo: https://github.com/psf/black + rev: 22.3.0 + hooks: + - id: black + language_version: python3 + args: [] + exclude: gen/ + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v0.971 + hooks: + - id: mypy +#This can potentially be a slow pre-commit hook. + - repo: local + hooks: + - id: pytest-check + name: pytest-check + entry: pytest + language: system + pass_filenames: false + always_run: true diff --git a/setup.py b/setup.py index 9fe84c8..530fd8d 100644 --- a/setup.py +++ b/setup.py @@ -25,5 +25,5 @@ include_package_data=True, install_requires=["scipy", "numpy", "dacite"], python_requires=">=3.8", - extras_require={"dev": ["pytest", "black", "mypy"]}, + extras_require={"dev": ["pytest", "black", "mypy", "pre-commit"]}, )