From 18ae45e4c89d0bca1d6b4d61b60f21f2dc95b5b6 Mon Sep 17 00:00:00 2001 From: Adar Nimrod <nimrod@shore.co.il> Date: Sun, 23 Feb 2020 11:50:23 +0200 Subject: [PATCH] Pre-commit. Add pre-commit checks and fix very small issues. --- .pre-commit-config.yaml | 54 +++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 1 - requirements.txt | 2 +- 3 files changed, 55 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..fcf366d --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,54 @@ +# vim:ff=unix ts=2 sw=2 ai expandtab +--- +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.5.0 + hooks: + - id: check-added-large-files + - id: check-executables-have-shebangs + - id: check-merge-conflict + - id: check-symlinks + - id: detect-private-key + - id: trailing-whitespace + - id: requirements-txt-fixer + - repo: https://github.com/adrienverge/yamllint + rev: v1.20.0 + hooks: + - id: yamllint + - repo: https://github.com/amperser/proselint/ + rev: 0.10.2 + hooks: + - id: proselint + types: [plain-text] + exclude: LICENSE + - repo: https://github.com/ambv/black + rev: 19.10b0 + hooks: + - id: black + exclude: &excluded_pythonscripts pythonrc.py|rabbitmqadmin + args: + - | + --line-length=79 + - repo: https://gitlab.com/pycqa/flake8 + rev: 3.7.9 + hooks: + - id: flake8 + exclude: *excluded_pythonscripts + args: + - |- + --max-line-length=79 + additional_dependencies: + - flake8-bugbear + - repo: https://github.com/pre-commit/mirrors-pylint + rev: v2.4.4 + hooks: + - id: pylint + exclude: *excluded_pythonscripts + args: + - |- + --disable=R0801 + - repo: https://www.shore.co.il/git/docker-pre-commit + rev: v0.3.0 + hooks: + - id: hadolint + - id: docker-compose diff --git a/docker-compose.yml b/docker-compose.yml index d6a0570..6047329 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,4 +14,3 @@ services: image: rabbitmq:3.8-management-alpine ports: - 15672:15672 - diff --git a/requirements.txt b/requirements.txt index 4e156fb..468914a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -flask>=1.1 celery[librabbitmq]>=4.4 +flask>=1.1 -- GitLab