name: Misc linters

on: [push, pull_request]

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  cancel-in-progress: true

jobs:
  misc:
    name: misc linters
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Ensure git safe directory
        run: |
          git config --global --add safe.directory $(pwd)
      - name: check spell
        run: |
          pip install codespell
          # exclude files which may be synchronized from other places
          git ls-files | grep -v "^thirdparty" | grep -v "/thirdparty/" | grep -v '^docs/witx' | xargs -t codespell --ignore-words .github/workflows/ignore_words 2>/dev/null
