Guide: Setting Up Linting and CI

Related issue: #24

Context

The FEAST codebase has no automated linting or CI checks. This means style issues, unused imports, and simple bugs go unnoticed until someone reads the code. Setting up linting is a small change that pays off on every future PR.

Beyond this project: Linting reveals hundreds of issues at once. Notice the approach: assess the full problem, triage by impact, ship the highest-value piece, document what’s deferred. This is how professionals scope any large task where you can’t fix everything at once.

Before You Start

Steps

1. Add flake8 to dev dependencies

uv add --dev flake8

2. Create a .flake8 config file in the project root

[flake8]
# Line length is unrestricted per project convention
extend-ignore = E501
max-complexity = 10

# Exclude files we haven't cleaned up yet
exclude =
    .venv,
    lib,
    __pycache__,
    *.egg-info

3. Run flake8 and assess the damage

uv run flake8

You’ll likely get hundreds of errors. Don’t fix them all. Instead:

4. Add a GitHub Actions workflow

Create .github/workflows/lint.yml:

name: Lint

on:
  pull_request:
    branches: [dev, main]

jobs:
  backend-lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: astral-sh/setup-uv@v4
      - run: uv sync --dev
      - run: uv run flake8

  frontend-lint:
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: fass-frontend/fass-react
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 18
      - run: npm ci
      - run: npx eslint src/

5. Verify locally

uv run flake8           # should pass (0 exit code)

LLM Usage

Definition of Done

While You’re In There

Stretch Goals