Conversation
Adds a lint gate to CI alongside the existing test matrix, with a
small one-time cleanup of what surfaced on the v0.3.8 codebase.
Python (ruff)
==============
Config in pyproject.toml [tool.ruff]:
line-length = 100
target-version = "py310"
select = E, F, I, B, UP, SIM
ignore = E501
Cleanup applied:
- src/agent_inbox/db.py:
* UP035: imports moved from `typing` to `collections.abc` for
Callable + Iterator
* SIM108: replaced if/else with ternary in insert_message status
assignment
- tests/test_concurrency.py: removed unused `typing.Any` import (F401)
- tests/test_patton_v035.py: removed unused `unittest.mock` import
(F401) and dead `full` set in test_broadcast_calls_agents_once_per
target (F841)
ruff itself added to dev deps (>=0.6).
Go (golangci-lint v2)
=======================
Config at ui/.golangci.yml:
version: "2"
default linter set: standard
enabled extras: misspell, unconvert, gocritic
gocritic: ifElseChain disabled (reads worse than the chain in our code)
errcheck: exclude (*database/sql.Rows).Close — `defer rows.Close()`
is the idiomatic Go pattern and the actionable error cases are
checked elsewhere; we don't want to noise up code with `_ =` shims
Code is already clean against this config — zero issues — so no
source changes needed.
CI integration
================
New job: lint (ruff + golangci-lint), parallel with the test matrix,
ubuntu-only. ci-all-green aggregator updated to require lint as well,
so future branch-protection rulesets keep covering it via the single
stable check name.
Tests
=======
159 Python + 7 Go still passing locally, no behavior changes.
golangci-lint type-checks the Go sources, which means it needs to resolve //go:embed all:frontend/dist in main.go — same prereq the go test job already handles. Without the build step the lint action fails with 'invalid go:embed: build system did not supply embed configuration' before any actual lint check runs. Caught immediately in the v0.3.9 PR's first CI run. Adding npm ci + npm run build before the golangci-lint action mirrors the test job.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a lint gate to CI alongside the test matrix. Cleans up the small amount of lint debt surfaced on the v0.3.8 codebase.
Type of change
What this catches
ruff checkgolangci-lint v2Cleanup applied
src/agent_inbox/db.pycollections.abcsrc/agent_inbox/db.pytests/test_concurrency.pytyping.Anytests/test_patton_v035.pyunittest.mockimport + deadfullvariableGo side was already clean against the chosen config — zero issues, no source changes.
Aggregator update
ci-all-greennow requires[lint, python, go-and-frontend]to all succeed. Single stable check name for the eventual branch protection ruleset.Checklist
ruff checkcleangolangci-lint runcleanNotes for the reviewer
Doesn't add backward-incompatible behavior; pure infra + cosmetics. The
errcheck*database/sql.Rows.Closeexclusion is the idiomatic Go practice — seelinters-settings.errcheck.exclude-functionsinui/.golangci.ymlfor the rationale.