From 7d03accf689753a9d76b52f2c5f4353d361e30a1 Mon Sep 17 00:00:00 2001 From: glrs <5999366+glrs@users.noreply.github.com> Date: Thu, 3 Oct 2024 16:37:22 +0200 Subject: [PATCH] Add GitHub Actions workflow for linting and type checking --- .github/workflows/lint.yml | 67 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..d74c408 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,67 @@ +# .github/workflows/lint.yml + +name: Lint and Type Check + +on: [ push, pull_request ] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + ruff-check: + name: Ruff Linting + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.11" + + - name: Install Ruff + run: | + python -m pip install --upgrade pip + pip install ruff + + - name: Run Ruff (Check for style violations) + run: ruff check . --exit-zero + + black-check: + name: Black Formatting + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.11" + + - name: Install Black + run: pip install black + + - name: Run Black (Check) + run: black --check . + + mypy-check: + name: Mypy Type Checking + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.11" + + - name: Install Dependencies + run: | + pip install mypy + + - name: Run Mypy + run: mypy . \ No newline at end of file