Skip to content

tooling: Add ruff linting and CI workflow. #7

@nedseb

Description

@nedseb

What

Add a minimal linting setup so that syntax errors and basic style issues are caught automatically on PRs.

Blocked by

Tasks

1. Create pyproject.toml

[project]
name = "micropython-steami-sample"
version = "0.1.0"
description = "MicroPython sample scripts for the STeaMi board."

[tool.ruff]
line-length = 99
target-version = "py310"

[tool.ruff.lint]
select = ["E", "F", "W"]
ignore = ["E501"]

Only basic rules (pycodestyle + pyflakes) — enough to catch real errors without being too strict for example code.

2. Create .github/workflows/lint.yml

name: Lint
on: [push, pull_request]
jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.10"
      - run: pip install ruff
      - run: ruff check .

3. Fix existing violations

Run ruff check . on the repo and fix any issues (auto-fixable with ruff check --fix, the rest manually).

Why

Currently there is no CI and no linting. Syntax errors or broken imports can be merged without anyone noticing. A 3-line workflow + a 10-line config file prevents that.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions