name: Code Linter

on:
  push:
    branches:
      - dev
  workflow_dispatch:
  workflow_call:
  pull_request:
    branches:
      - dev

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          submodules: recursive

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version-file: '.nvmrc'

      - name: Setup autopep8
        run: sudo apt install python3-autopep8

      - name: Install dependencies
        run: npm install

      - name: Lint
        run: npm run lint
