summaryrefslogtreecommitdiffstats
path: root/.github/workflows/linter.yml
blob: 53d1b1b9596f713fcf6304d27e6699d0a90be148 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
# vi: ts=2 sw=2 et:
# SPDX-License-Identifier: LGPL-2.1-or-later
# https://github.com/marketplace/actions/super-linter
name: Lint Code Base

on:
  pull_request:
    branches:
      - main
      - v[0-9]+-stable

permissions:
  contents: read

jobs:
  build:
    name: Lint Code Base
    runs-on: ubuntu-24.04
    concurrency:
      group: ${{ github.workflow }}-${{ github.ref }}
      cancel-in-progress: true

    steps:
      - name: Repo checkout
        uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
        with:
          # We need a full repo clone
          fetch-depth: 0

      - name: Lint Code Base
        uses: super-linter/super-linter/slim@b92721f792f381cedc002ecdbb9847a15ece5bb8
        env:
          DEFAULT_BRANCH: main
          MULTI_STATUS: false
          VALIDATE_ALL_CODEBASE: false
          VALIDATE_GITHUB_ACTIONS: true

      - name: Check that tabs are not used in Python code
        run: sh -c '! git grep -P "\\t" -- src/ukify/ukify.py'

      - name: Install ruff and mypy
        run: |
          python3 -m pip install --break-system-packages --upgrade setuptools wheel pip
          python3 -m pip install --break-system-packages mypy types-Pillow ruff

      - name: Run mypy
        run: |
          python3 -m mypy --version
          python3 -m mypy src/ukify/ukify.py

      - name: Run ruff check
        run: |
          ruff --version
          ruff check src/ukify/ukify.py

      - name: Run ruff format
        run: |
          ruff --version
          ruff format --check src/ukify/ukify.py