Skip to content

chore: enable uncomment lint #733

chore: enable uncomment lint

chore: enable uncomment lint #733

Workflow file for this run

name: CI Validate
on:
push:
branches: [main]
paths:
- "crates/**"
- "packages/**"
- "e2e/**"
- "scripts/**"
- "Cargo.toml"
- "Cargo.lock"
- "rust-toolchain.toml"
- "pyproject.toml"
- "pnpm-workspace.yaml"
- "package.json"
- "alef.toml"
- ".github/workflows/ci-validate.yaml"
- ".github/actions/**"
pull_request:
branches: [main]
paths:
- "crates/**"
- "packages/**"
- "e2e/**"
- "scripts/**"
- "Cargo.toml"
- "Cargo.lock"
- "rust-toolchain.toml"
- "pyproject.toml"
- "pnpm-workspace.yaml"
- "package.json"
- "alef.toml"
- ".github/workflows/ci-validate.yaml"
- ".github/actions/**"
workflow_run:
workflows: ["Publish Release"]
types: [completed]
workflow_dispatch:
concurrency:
group: ci-validate-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
validate-rust:
name: Rust Validation
if: github.repository == 'xberg-io/tree-sitter-language-pack' && github.actor != 'dependabot[bot]'
needs: [clone-vendors]
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Download parsers
uses: actions/download-artifact@v8
with:
name: language-parsers
path: parsers
- name: Setup Rust
uses: xberg-io/actions/setup-rust@v1
with:
use-sccache: "false"
install-llvm-cov: "false"
- name: Check Rust formatting
run: cargo fmt --check
- name: Run clippy
run: cargo clippy --locked --workspace --exclude ts-pack-core-wasm -- -D warnings
env:
PROJECT_ROOT: ${{ github.workspace }}
TSLP_LANGUAGES: "python,rust,javascript,typescript,go,html,css,json"
TSLP_LINK_MODE: static
- name: Install alef
uses: xberg-io/actions/install-alef@v1
- name: Verify binding API parity
run: alef verify
- name: Check README freshness
run: |
alef readme
# Ignore whitespace-only diffs — markdown formatter (rumdl) collapses
# blank lines and table column padding that alef emits.
git diff -w --ignore-blank-lines --exit-code -- packages/*/README.md crates/*/README.md || {
echo "::error::READMEs are out of date. Run 'alef readme' and commit."
exit 1
}
- name: Check API docs freshness
run: |
alef docs
# Ignore whitespace-only diffs — markdown formatter (rumdl) collapses
# blank lines and table column padding that alef emits.
git diff -w --ignore-blank-lines --exit-code -- docs/reference/ || {
echo "::error::API docs are out of date. Run 'alef docs' and commit."
exit 1
}
- name: Check version sync
run: |
# --skip-swift-checksum: the Linux runner can't install
# aarch64-apple-darwin without Xcode/rustup target add, so the
# Swift artifactbundle checksum substitution that's normally
# part of sync-versions fails with E0463 on cfg-if/libc.
# Skip it here; the checksum will be re-synced on rc-cut from
# the macOS-equipped local environment + the publish workflow.
alef sync-versions --skip-swift-checksum
# Ignore whitespace-only diffs — `alef readme` (run in a previous
# step) leaves rumdl-vs-alef blank-line drift in crates/*/README.md
# files that's tolerated by the freshness check above but would
# otherwise trip this strict diff. Real version drift will still
# show up (manifest version strings have no whitespace ambiguity).
git diff -w --ignore-blank-lines --exit-code -- packages/ crates/ || {
echo "::error::Versions are out of sync. Run 'alef sync-versions' and commit."
exit 1
}
clone-vendors:
name: Clone vendors
if: github.repository == 'xberg-io/tree-sitter-language-pack' && github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "22"
- name: Install tree-sitter CLI
run: npm install -g tree-sitter-cli
- name: Install uv
uses: astral-sh/setup-uv@v8.2.0
with:
enable-cache: true
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Install Python dependencies
run: uv sync --no-install-project --no-install-workspace
- name: Cache parsers
uses: actions/cache@v5
with:
path: parsers
key: parsers-${{ hashFiles('sources/language_definitions.json') }}
restore-keys: |
parsers-
- name: Clone vendors
run: |
mkdir -p parsers
uv run --script scripts/clone_vendors.py
- name: Upload parsers
uses: actions/upload-artifact@v7
with:
name: language-parsers
path: parsers
retention-days: 1