name: Formatter and linter

on:
  push:
    branches: [ '**' ]

permissions:
  contents: read

env:
  CARGO_TERM_COLOR: always

jobs:
  ast-grep:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
    - name: Install uv
      uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
    - name: Install ast-grep
      run: uv tool install ast-grep-cli
    - name: Check ast-grep rules (.ast-grep/rules)
      run: ast-grep scan --format github
