fix: graceful RC keys, JSON encode-error stream, and docs#87
Merged
Conversation
Follow-ups from the v0.7.0 batch code review: - app: skip .structalignrc keys that don't map to a flag (the documented theme exclusion and typos) instead of warning "no such flag"; a real flag given a bad value still warns. - ui: RenderJSON returns its encode error instead of writing to the real os.Stderr; app.Run reports it on App.Stderr and exits 2. - docs: document that the JSON diff document always carries the summary block and that -format=json ignores the text presentation flags. - test(align): replace the unfinished readSource bounds comment with a deliberate note on why the remaining guards are uncovered. Closes #86 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add .bestpractices.json to the repository root containing all self-assertions and justifications for the project's security, quality, reporting, and licensing criteria. This allows the OpenSSF Best Practices portal to automatically parse and pre-populate the project's questionnaire, bypassing the need for manual form submission.
ad59394 to
a6aa537
Compare
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.
Follow-ups from the v0.7.0 batch code review (PRs #63–#74).
Changes
internal/app/app.go):.structalignrckeys that don't map to a flag are now skipped silently. This covers the documented "theme is not an RC key" exclusion and typos, which previously surfaced a confusingconfig: <key>: no such flagwarning. A key that is a flag but gets a bad value still warns (e.g.threshold = garbage).internal/ui/json.go):RenderJSONnow returns its encode error instead of writing to the realos.Stderr(thePrinterholds no stderr handle).app.Runreports it on the injectedApp.Stderrand exits 2.README.md,AGENTS.md): new "JSON output" section documenting the two deliberate divergences from text mode — the diff document always carries thesummaryblock (so machine consumers always get totals;-summarygoverns only the text trailing line), and the presentation flags (-diff/-summary/-verbose/-color/-width) are ignored in JSON.internal/align/internal_test.go): replaced the unfinishedreadSourcebounds comment with a deliberate note on why the remaining guards are intentionally uncovered.Tests
TestRunRCUnknownKeyscovering the theme key, a typo'd key (both silent), and a bad value for a real flag (still warns).RenderJSONcallers updated to assertNoError.task cigate green (tidy, lint, go-consistent, build, test, smoke); golden fixtures unchanged.Closes #86
🤖 Generated with Claude Code