name: Lint

on:
  push:
  pull_request:

jobs:
  luacheck:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install luacheck
        run: sudo apt-get update && sudo apt-get install -y lua5.1 luarocks && sudo luarocks install luacheck

      # Catches what the local structural check can't: undefined globals, unused
      # variables, shadowing. The .luacheckrc declares the WoW API as known globals.
      - name: Run luacheck
        run: luacheck . --no-color -q
