Skip to content

Polish - #6

Merged
nnutter merged 11 commits into
masterfrom
polish
Sep 9, 2026
Merged

nnutter merged 11 commits into
masterfrom
polish

Conversation

@nnutter

@nnutter nnutter commented Sep 9, 2026

Copy link
Copy Markdown
Owner

No description provided.

Constable's methodical check requires each method to live in the
same file as its receiver type. Consolidate all app methods in
roam.go so lint-constable's same-file diagnostics pass.

This is a pure move with no behavior change and leaves method
ordering untouched for the follow-up sorting commit.
Constable's methodical check requires methods sharing a type and
file to be sorted by name. Reorder the consolidated app methods
in roam.go with no behavior change.
Constable's testify check requires test failures to use
testify/require instead of testing.Fatal methods. Convert
helpers and assertions with no behavior change.
The helper only wrapped require.Equal, so it added indirection
without adding meaning. Inlining it keeps assertions uniform with
the rest of the tests.
As a single statement, the predicate reported 100% statement
coverage even though the help-matching outcome was never tested.
Splitting the length guard from the flag match makes statement
coverage reveal that gap, which upcoming root-help tests will
close.
The previous assertions indexed into the call log by position,
which silently assumed call order and argument layout. Asserting
the complete expected call list makes the test self-describing and
catches unintended changes anywhere in the setup sequence.
Running roam with no args, -h, or --help must print roam's own
help rather than exec git, which would otherwise print git usage
or pass -h through. These cases guard the DisableFlagParsing root
command and the isHelpArg predicate, whose help-matching branch was
previously uncovered.
Scripts depend on roam exiting with git's exit code, and users
depend on roam not printing a second error after git has already
written its own message to stderr. Neither behavior was covered.
The fake git now fails with exit code 3 so the propagation test
cannot pass via the generic fallback of 1.
DisableFlagParsing on the root command is what lets users run
commands like 'roam --no-pager log' without cobra intercepting the
flag, and the exec wiring is what delivers git's output to the
user's terminal. Both were untested, so a regression in either
would not have been caught.
The existing tests verify roam invokes git with the expected
arguments but never that those arguments actually work, so a broken
setup sequence (for example a checkout that fails against a freshly
fetched remote) would pass the suite. This test runs setup against
a real local origin, rewritten from the GitHub URL via insteadOf,
and verifies the dotfile is checked out into the home directory
with a clean status.
@nnutter
nnutter merged commit e278a38 into master Sep 9, 2026
1 check passed
@nnutter
nnutter deleted the polish branch September 9, 2026 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant