Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ jobs:
working-directory: ${{ steps.pyproject.outputs.path }}
run: ruff format --check .

- name: Mypy
# Mypy is a HARD CI gate — strict mode is configured in pyproject.toml
# ([tool.mypy] strict = true). We do not use `|| true` here; type-check
# regressions must fail CI, not be merged silently. See CONTRIBUTING.md.
- name: Mypy (strict, blocking)
if: steps.pyproject.outputs.exists == 'true'
working-directory: ${{ steps.pyproject.outputs.path }}
run: mypy app/
Expand Down
24 changes: 18 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ This project takes **AI-assisted code review seriously** as part of the standard

**One feature = one branch = one PR.** Don't bundle unrelated changes — that defeats the review value. If you discover an unrelated bug while working on a feature, file a separate issue and a separate PR.

**Wait for the AI reviewers, even on small PRs.** Gemini and Copilot post within ~1-2 minutes. Merging a small "trivial" PR with `--admin` before they've commented forfeits the review value and makes follow-up comments awkward to address. If a PR is *truly* time-critical (security fix, broken main), call it out explicitly in the PR description and own that you're skipping the review window — and address any post-merge comments in a follow-up PR.

**Side-effects must be in the PR description.** If a PR primarily fixes A but also changes B, list both in the description. Reviewers shouldn't have to discover changes by reading the diff line by line.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The PR description mentions changes to ci.yml (renaming the mypy step and adding a rationale comment), but these changes are not present in the current diff. Given the new rule added in this line regarding documenting side-effects, please ensure the ci.yml modifications are included in the PR to maintain consistency.


## Adding a new printer model (plugin)

Want to add support for a new Brother model (or even a non-Brother printer)? Excellent.
Expand All @@ -169,16 +173,24 @@ We try to verify each plugin against real hardware before merging when feasible.

## Local CI checks

Before opening a PR:
Before opening a PR, run from `backend/`:

```bash
ruff check . # linting
ruff format --check . # formatting
mypy app/ # type checking
pytest # tests
ruff check . # linting (blocking in CI)
ruff format --check . # formatting (blocking in CI)
mypy app/ # type checking (blocking in CI — strict mode)
pytest # tests (blocking in CI)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To align the local check with the CI 'hard gate' for coverage (80% floor), the command should include the coverage flag. Running pytest alone will not trigger the coverage enforcement defined in pyproject.toml.

Suggested change
pytest # tests (blocking in CI)
pytest --cov # tests + coverage (blocking in CI)
References
  1. Behaviour changes without tests get pushed back. CI enforces an 80% coverage floor. (link)

```

The CI workflow runs the same. PRs that fail any check won't be reviewed until green.
The CI workflow runs the same. **All four are hard gates** — no warn-only:

- `ruff check` and `ruff format --check` reject style/lint issues
- `mypy` runs in strict mode (configured in `pyproject.toml` `[tool.mypy] strict = true`); type-check failures fail the build
- `pytest` requires all tests pass; coverage floor is 80% (configured in `pyproject.toml`)
Comment on lines +185 to +189

If you want to bypass a gate locally during exploration, use `mypy --no-strict-optional` etc., but the merged code must pass strict checks.

PRs that fail any check won't be reviewed until green.

## Releases

Expand Down
Loading