---
name: pylint

on:
  push:
    paths:
      - "**.py"
      - ".pylintrc"
      - "requirements.txt"
      - ".github/workflows/pylint.yaml"
  pull_request:
    paths:
      - "**.py"
      - ".pylintrc"
      - "requirements.txt"
      - ".github/workflows/pylint.yaml"

jobs:
  pylint:

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.8
      - name: Install pylint
        run: pip install pylint
      - name: pylint files
        # https://stackoverflow.com/a/63044665/861745
        run: pylint $(git ls-files '*.py')
