From 86caa140c2d08bf71872fa41d2a8f82d4ea60845 Mon Sep 17 00:00:00 2001 From: s-weigand Date: Fri, 4 Dec 2020 16:26:22 +0100 Subject: [PATCH] Added pre-commit and a basic config containing black+its config --- .pre-commit-config.yaml | 14 ++++++++++++++ pyproject.toml | 17 +++++++++++++++++ requirements_dev.txt | 1 + 3 files changed, 32 insertions(+) create mode 100644 .pre-commit-config.yaml create mode 100644 pyproject.toml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..65d990e83 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,14 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.3.0 + hooks: + - id: check-ast + - id: check-builtin-literals + - id: end-of-file-fixer + - id: trailing-whitespace + + - repo: https://github.com/python/black + rev: 20.8b1 + hooks: + - id: black + language_version: python3 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..845901a54 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,17 @@ +[tool.black] +line-length = 79 +target-version = ['py27', 'py35', 'py36', 'py37', 'py38', 'py39'] +exclude = ''' +/( + \.eggs + | \.git + | \.hg + | \.mypy_cache + | \.tox + | \.venv + | _build + | buck-out + | build + | dist +)/ +''' diff --git a/requirements_dev.txt b/requirements_dev.txt index 95ded8956..8e45446fc 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -8,6 +8,7 @@ six==1.15.0 pytest pytest-cov coverage +pre-commit flake8 #deployment