Skip to content

Align the codebase with Effective Go conventions - #23

Merged
namest504 merged 17 commits into
mainfrom
refactor/effective-go
Aug 21, 2026
Merged

Align the codebase with Effective Go conventions#23
namest504 merged 17 commits into
mainfrom
refactor/effective-go

Conversation

@namest504

Copy link
Copy Markdown
Owner

Summary

  • Package comments added for ui, domain, app, themes, and the termtype command
  • Doc comments completed to the standard name-first full-sentence form
  • Initialism capitalized: GameState.Wpm -> WPM (mechanical rename, in-memory field only; history json tags untouched)
  • Idioms: range-over-string instead of []rune conversions, slice preallocation in sortedThemeNames
  • Behavior unchanged: full test suite passes; verified with go vet and staticcheck

Production code only — pairs with the test-quality PRs beneath it.

Make chartStyles the single source of truth for style codes so
chartOptionsFor and newSettingsModel can no longer disagree on the
fallback for an unknown code: both now fall back to braille2 instead
of chartOptionsFor's braille2 vs newSettingsModel's index-0 braille1,
which used to render braille2, display braille1, and silently rewrite
the config to braille1 on any unrelated settings change.

Also: drawSettings truncates rows/help to terminal width like
drawMenu/history do; renderBraille's loop locals no longer shadow the
lo/hi bounds parameters; MockScreen in typing_renderer_test.go keeps
one cell map instead of two.
@namest504
namest504 changed the base branch from test/style-and-docs to main August 21, 2026 00:24
@namest504
namest504 merged commit fd654c4 into main Aug 21, 2026
1 check passed
@namest504
namest504 deleted the refactor/effective-go branch August 21, 2026 00:24
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