• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

umputun / revdiff / 24880690188
90%

Build:
DEFAULT BRANCH: master
Ran 24 Apr 2026 08:45AM UTC
Jobs 1
Files 60
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

24 Apr 2026 08:44AM UTC coverage: 89.446% (+0.01%) from 89.433%
24880690188

push

github

web-flow
fix(themes): persist theme into Application Options section (#149)

* fix(themes): persist theme into Application Options section

patchConfigTheme appended `theme = ...` at EOF when no existing theme line
was found. If the config ended with `[color options]` (or any non-default
section), the new line landed inside that section and go-flags reported
`unknown option: theme` on next startup, discarding the setting. Now the
insert skips past any [Application Options] headers and places the entry
just before the first non-default section header (or at EOF if none).

Also promoted patchConfigTheme to a method on *themeCatalog since it was
called only from themeCatalog.Persist.

Related to #148

* style: gofmt column alignment in two test files

* fix(themes): heal misplaced theme line and round-trip tests

Code-review followup to the #148 fix.

The replace-in-place branch of patchConfigTheme was matching the first
`theme = ...` line anywhere in the file and rewriting it at the same
location. If a user's config was already corrupted by the pre-fix persist
path (theme line stuck inside `[color options]`), the new binary kept
rewriting at the wrong location and go-flags still reported
`unknown option: theme` on next startup.

Make the scan section-aware: track the active INI section while walking
lines; replace in place only when the found line lives in the default
scope ([Application Options] or the unnamed top-of-file section);
otherwise delete the stray line and run the insertion path so the new
entry lands before the first non-[Application Options] header.

Also split the scan and insertion-position logic into two helper methods
on *themeCatalog to keep cyclomatic complexity within the linter limit.

Add an end-to-end regression test that round-trips patched files through
flags.NewIniParser and asserts opts.Theme resolves without error,
covering three testdata fixtures (good / no-theme-yet / corrupted). This
is the assertion that would have caught #148 or... (continued)

48 of 52 new or added lines in 1 file covered. (92.31%)

8441 of 9437 relevant lines covered (89.45%)

551.27 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
84.89
1.3% app/themes.go
Jobs
ID Job ID Ran Files Coverage
1 24880690188.1 24 Apr 2026 08:45AM UTC 60
89.45
GitHub Action Run
Source Files on build 24880690188
  • Tree
  • List 60
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • ab3c101a on github
  • Prev Build on master (#24860662493)
  • Next Build on master (#24880799586)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc