From d6d6f795b135f106d8d88f95a56d24efe0ee9ee5 Mon Sep 17 00:00:00 2001 From: TheRealSeber Date: Mon, 27 Nov 2023 19:46:08 +0100 Subject: [PATCH] feat: pipeline --- .github/workflows/pre-commit.yaml | 18 ++++++++++++++ .pre-commit-config.yaml | 41 +++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 .github/workflows/pre-commit.yaml create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml new file mode 100644 index 0000000..0a905b6 --- /dev/null +++ b/.github/workflows/pre-commit.yaml @@ -0,0 +1,18 @@ +name: pre-commit + +on: push + +jobs: + run-linters: + runs-on: ubuntu-latest + steps: + - name: Check out Git repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Set up pre-commit Cache + uses: pre-commit/action@v3.0.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..e709756 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,41 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-ast + exclude: ^.*\/.*copy.*$ + # Explanation: ^.*\/copy\.py$ matches any file containing "copy" word in any directory. + - id: check-yaml + exclude: ^.*\/.*copy.*$ + - id: check-added-large-files + exclude: ^.*\/.*copy.*$ + - id: end-of-file-fixer + exclude: ^.*\/.*copy.*$ + - id: trailing-whitespace + exclude: ^.*\/.*copy.*$ + + - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt + rev: 0.2.1 + hooks: + - id: yamlfmt + exclude: ^.*\/.*copy.*$ + + - repo: https://github.com/asottile/reorder-python-imports + rev: v3.12.0 + hooks: + - id: "reorder-python-imports" + exclude: ^.*\/.*copy.*$ + + - repo: https://github.com/PyCQA/flake8 + rev: 6.1.0 + hooks: + - id: flake8 + args: [--max-line-length=88] + exclude: ^.*\/.*copy.*$ + + - repo: https://github.com/psf/black + rev: 23.9.1 + hooks: + - id: black + language_version: python3.11 + exclude: ^.*\/.*copy\.py$