Skip to content

Tooling Reference

Quick reference for all linting, formatting, type checking, and testing commands across the FiberPath stack.

Python Backend

Commands run from project root with uv run <tool>:

Command Tool Purpose
uv run ruff check Ruff Linting (style, imports, best practices)
uv run ruff format Ruff Code formatting (replaces black)
uv run mypy MyPy Static type checking (strict mode)
uv run pytest -v Pytest Run test suite with verbose output

Config Locations:

  • Ruff: [tool.ruff] and [tool.ruff.lint] in pyproject.toml
  • MyPy: [tool.mypy] in pyproject.toml
  • Pytest: [tool.pytest.ini_options] in pyproject.toml
  • Coverage: [tool.coverage.run] in pyproject.toml

Additional Commands:

uv run ruff check --fix        # Auto-fix linting issues
uv run pytest -v --cov         # Run tests with coverage
uv build                       # Build Python package (dist/)

GUI Frontend (TypeScript/React)

Commands run from fiberpath_gui/ directory with npm run <script>:

Script Command Tool Purpose
lint tsc --noEmit TypeScript Type checking (no output files)
lint:css stylelint "src/**/*.css" Stylelint CSS linting
lint:css:fix stylelint "src/**/*.css" --fix Stylelint Auto-fix CSS issues
format:check cd src-tauri && cargo fmt --check Rustfmt Check Rust formatting
format:fix cd src-tauri && cargo fmt Rustfmt Format Rust code
clippy cd src-tauri && cargo clippy -- -D warnings Clippy Rust linting
check:all (composite) Multiple Run all checks (TS, CSS, Rust format, clippy)
test vitest Vitest Run GUI tests (watch mode)
test:coverage vitest run --coverage Vitest Run tests with coverage report
build vite build Vite Build production bundle
perf:bundle node scripts/check-bundle-budget.mjs Node Enforce JS/CSS bundle budget + emit metrics

Alias Location: fiberpath_gui/package.json"scripts"

Config Locations:

  • TypeScript: tsconfig.json and tsconfig.node.json in fiberpath_gui/
  • Stylelint: Uses stylelint-config-standard (installed package)
  • Vitest: vitest.config.ts in fiberpath_gui/
  • Vite: vite.config.ts in fiberpath_gui/
  • Rust: src-tauri/Cargo.toml

Recommended Local Sequence:

cd fiberpath_gui
npm run check:all
npm test
npm run build

Pre-Commit Automation

FiberPath uses a repo-root pre-commit configuration (.pre-commit-config.yaml) for baseline commit-time checks across Python and GUI code.

One-time setup

uv run pre-commit install

Run manually on demand

uv run pre-commit run --all-files

Hook coverage

  • File hygiene: trailing whitespace, end-of-file, merge-conflict markers, large-file guard
  • Python: Ruff lint (--fix) and Ruff format for backend/test paths
  • GUI: TypeScript type check (npm --prefix fiberpath_gui run lint) for TS/TSX changes
  • GUI: Stylelint (npm --prefix fiberpath_gui run lint:css) for CSS changes

CI/CD Equivalents

What GitHub Actions runs (match locally before pushing):

Backend CI:

uv run ruff check           # Linting
uv run ruff format --check  # Format verification
uv run mypy                 # Type checking
uv run pytest -v --cov --cov-report=xml

GUI CI:

cd fiberpath_gui
npm run lint                     # TypeScript type checking (tsc --noEmit)
npm run lint:css                 # Stylelint (CSS)
npm run lint:css:vars            # CSS variable guard
npm run format:check             # Rust formatting check
npm run clippy                   # Rust linting
npm test                         # Vitest
npm run test:coverage            # Coverage report
npm run build                    # Vite build
npm run perf:bundle              # Bundle budget + metrics report

Quick Command Summary

Task Python GUI
Format uv run ruff format npm run format:fix (Rust only)
Lint uv run ruff check npm run lint (TS), npm run lint:css (CSS), npm run clippy (Rust)
Type Check uv run mypy npm run lint (tsc)
Test uv run pytest -v npm test
Build uv build npm run build
All Checks uv run ruff check && uv run ruff format && uv run mypy npm run check:all