From 94cf339dd8cef779550d00812c39c5a3e2521113 Mon Sep 17 00:00:00 2001 From: Arthur Pastel Date: Mon, 12 Sep 2022 11:44:49 +0200 Subject: [PATCH] Add pre-commit and an initial CI --- .github/workflows/ci.yml | 19 +++++++++++++++++++ .pre-commit-config.yaml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..38aca48 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,19 @@ +name: CI +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + static-analysis: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: "3.9" + - uses: pre-commit/action@v2.0.0 + with: + extra_args: --all-files \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..3e31f3b --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,30 @@ +# 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.4.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + - repo: https://github.com/prettier/prettier + rev: 1.19.1 + hooks: + - id: prettier + - repo: https://github.com/psf/black + rev: 19.3b0 + hooks: + - id: black + - repo: https://github.com/timothycrosley/isort.git + rev: "4.3.21-2" + hooks: + - id: isort + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v0.740 + hooks: + - id: mypy + - repo: https://gitlab.com/pycqa/flake8.git + rev: 8f9b4931b9a28896fb43edccb23016a7540f5b82 + hooks: + - id: flake8