# SPDX-FileCopyrightText: 2023 Samuel Tyler <samuel@samuelt.me>
#
# SPDX-License-Identifier: GPL-3.0-or-later

name: Linters

on:
  workflow_dispatch:
  pull_request:
  push:
    branches:
      - master

jobs:
  pylint:
    name: Lint Python files
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repo
        uses: actions/checkout@v3
      - name: Install pylint
        run: sudo pip3 install pylint
      - name: pylint
        run: pylint rootfs.py source_manifest.py lib/*.py --disable=duplicate-code

  shellcheck:
    name: Lint shell files
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repo
        uses: actions/checkout@v3
      - name: shellcheck
        run: shellcheck steps/helpers.sh download-distfiles.sh mirror.sh

  reuse:
    name: Lint reuse information
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repo
        uses: actions/checkout@v3
      - name: Install reuse
        run: sudo pip3 install reuse
      - name: reuse
        run: reuse lint
