Add Whitaker to lint checks#28
Conversation
Run Whitaker as part of the local lint target and install the pinned Whitaker installer in CI before invoking `make lint`. Refactor the existing interpolation helpers and test modules so the new Whitaker gate passes without suppressing the lint findings.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
OverviewThis pull request integrates Whitaker (a Dylint-based lint suite) into the repository lint contract for local and CI environments. make lint now runs Rustdoc, Clippy and Whitaker; CI installs a pinned whitaker-installer revision and runs whitaker-installer --cranelift before invoking the lint target. The change set includes a Whitaker-driven refactor of interpolation logic to reduce cyclomatic complexity and centralise error construction, plus test-only clean-ups, added tests, and broad documentation/formatting fixes. Infrastructure and CI
Commit messages focus on stabilising CI caching and installer bootstrap: cache key includes installer revision, skip reinstallation on cache hit, but still run the installer bootstrap (cranelift) before make lint. Code refactorings
Documentation and design links
(An execplan-type ADR describing the Whitaker lint contract was added — docs/adr-001-whitaker-lint-contract.md — and is referenced by the developers’ guide updates.) Review feedback and resolutionsReviewer points were addressed:
ValidationReported validation steps passed: actionlint, Makefile validation, formatting and markdown checks, whitaker-installer --cranelift, make lint (including Whitaker), cargo tests, make test, make test-scripts, and git diff checks. Whitaker findings were fixed rather than suppressed, enabling the new lint gate immediately. Notable test additions
WalkthroughIntegrate Whitaker installer into CI and Makefile; refactor collection-name interpolation and remote parsing; extract and expand settings tests; add test-module docs and make server test time helpers fallible; reflow docs and enforce dependency-version guidance. ChangesWhitaker Tool Integration
Collection Name Interpolation Refactoring
Settings Tests and Test Utilities
Test Documentation, Dependency Guidance, and Docs Formatting
Sequence Diagram(s): sequenceDiagram
participant CI as CI Workflow
participant Cache as actions/cache
participant Runner as GitHub runner
participant Installer as whitaker-installer
participant Make as Makefile lint
CI->>Cache: restore cache(key=runner.os + WHITAKER_INSTALLER_REV)
Cache-->>CI: cache hit / cache miss
CI->>Runner: on cache miss -> cargo install whitaker-installer --rev $WHITAKER_INSTALLER_REV --locked
CI->>Runner: run whitaker-installer --cranelift
Make->>Make: resolve WHITAKER via PATH or USER_WHITAKER fallback
Make->>Runner: run WHITAKER --all -- $(CARGO_FLAGS) with PATH augmented by USER_BIN_PATH
Possibly related PRs:
Poem:
🚥 Pre-merge checks | ✅ 18 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (18 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Reviewer's GuideIntegrates the Whitaker Dylint suite into the standard lint contract (Makefile + CI), documents how to install/run it locally, refactors interpolation and remote URL parsing into smaller helpers to satisfy new complexity lints, and performs minor test and markdown cleanups triggered by the new linting. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Document Whitaker's role as an architectural lint gate and add an ADR for the lint contract and interpolation refactoring strategy. Cover `Settings::from_env_with_git()` collection-name interpolation through the environment-loading path, keeping git context injectable for configuration tests. Restore contiguous Markdown footnote markers and add the reviewed clause commas so the documentation remains valid GitHub-flavoured Markdown.
Cache Whitaker binaries and generated lint artefacts in CI so repeated runs do not rebuild the installer and lint suite when the pinned revision is unchanged. Replace the placeholder bitflag helper with explicit grouped booleans. Keep remote and local placeholder needs separate so the code remains readable while satisfying the denied excessive-bool lint without a suppression.
|
@coderabbitai Have the following now been resolved? Annul any requirements that violate the en-GB-oxendict spelling (-ize / -yse / -our) conventions (for example a request to replace "normalize" with "normalise" or "artefact" with "artifact"), or where the requirement unnecessarily increases cyclomatic complexity. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chainLet me inspect the current state of the relevant files. 🏁 Script executed: Length of output: 28322
Overall Comment 1 —
|
Pin the Whitaker cache action to an immutable commit so CI does not depend on a floating `v4` tag. Bind settings-test environment mutation to a live `EnvGuard` instance and collapse the duplicated single-connection-mode validation tests into one parameterized `rstest` table. Use Oxford-style `recognized` spelling in the Whitaker documentation notes.
Cache the actual `~/.local/bin/whitaker` binary produced by the installer and bump the cache key so old incomplete cache entries are not reused. Always run `whitaker-installer --cranelift` before `make lint`, matching Weaver's CI invariant that the lint executable is bootstrapped in every job even when the installer is restored from cache.
Check the Whitaker cache step output before rebuilding `whitaker-installer`, while still running `whitaker-installer --cranelift` on every CI run so the lint executable is bootstrapped before `make lint`.
Summary
This branch adds Whitaker to the Dear Diary lint contract so local and CI linting now run Rustdoc, Clippy, and the Whitaker Dylint suite before the branch can pass review. It follows the current Weaver setup by installing the pinned Whitaker installer revision in CI before invoking
make lint.There is no linked issue, roadmap task, or execplan for this branch.
Review walkthrough
.github/workflows/ci.ymlandMakefileto see how Whitaker is installed and invoked.docs/developers-guide.mdfor the contributor-facing installation notes.crates/dear-diary-config/src/interpolation/mod.rsandcrates/dear-diary-config/src/interpolation/parse.rs.crates/dear-diary-config/src/settings.rs,crates/dear-diary-embeddings/src/fastembed.rs,crates/dear-diary-mcp/src/deprecation.rs,crates/dear-diary-mcp/src/server.rs,crates/dear-diary-mcp/src/server_tests.rs, andcrates/dear-diary-qdrant/src/entry.rs.AGENTS.md,docs/complexity-antipatterns-and-refactoring-strategies.md,docs/ortho-config-users-guide.md,docs/release-process.md,docs/reliable-testing-in-rust-via-dependency-injection.md,docs/rstest-bdd-users-guide.md,docs/rust-doctest-dry-guide.md,docs/rust-testing-with-rstest-fixtures.md, anddocs/users-guide.md.Validation
actionlint .github/workflows/ci.yml: passedmbake validate Makefile: passedmake check-fmt: passedmake markdownlint: passedmake nixie: passedwhitaker-installer --cranelift: passedmake lint: passed, including Whitakercargo test -p dear-diary-config interpolation: passedcargo test -p dear-diary-mcp --lib server::server_tests: passedmake test: passedmake test-scripts: passed, including 25 Python tests and 2 snapshotsgit diff --check: passedNotes
The first Whitaker run exposed existing complexity and test-module documentation findings. This branch fixes those findings directly rather than adding suppressions, so the newly added lint gate is active immediately.
Summary by Sourcery
Integrate the Whitaker lint suite into the project’s lint pipeline and refactor interpolation logic to satisfy new complexity checks while updating developer docs and tests accordingly.
Enhancements:
Build:
CI:
Documentation: