From 3e47fd49a9c26e0b2b6d4e116db3d01b86af65f0 Mon Sep 17 00:00:00 2001 From: Francesco Frassinelli Date: Tue, 18 Feb 2020 15:32:11 +0100 Subject: [PATCH] [Fixes #5719] Add pre-commit and black --- .pre-commit-config.yaml | 14 ++++++++++++++ pyproject.toml | 15 +++++++++++++++ requirements_dev.txt | 3 ++- 3 files changed, 31 insertions(+), 1 deletion(-) 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 00000000000..4527a569c31 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,14 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.5.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files +- repo: https://github.com/psf/black + rev: 19.10b0 + hooks: + - id: black diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000000..d99e26d67b2 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,15 @@ +[tool.black] +line-length = 120 +target-version = 'py35' +exclude = ''' +/( + geonode/.*/migrations/.* + | geonode/.*/settings.py + | management + | scripts + | docs + | static + | migrations + | node_modules +)/ +''' diff --git a/requirements_dev.txt b/requirements_dev.txt index 0f927da3275..063f6db2c95 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1 +1,2 @@ -ipdb \ No newline at end of file +ipdb +pre-commit