Rename testdata functions in panic-in-library-code linter for clarity - #55090
Merged
Merged
Conversation
1 of 10 tasks
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update function names for better clarity in panicinlibrarycode
Rename testdata functions in panic-in-library-code linter for clarity
Aug 23, 2026
pelikhan
marked this pull request as ready for review
August 23, 2026 14:25
Contributor
There was a problem hiding this comment.
Pull request overview
Improves naming clarity in panic-linter test fixtures and updates workflow routing references.
Changes:
- Renames five panic-linter fixture functions.
- Preserves the special top-level
init()test. - Adds the Drive Memory guide to the workflow router.
Show a summary per file
| File | Description |
|---|---|
panicinlibrarycode.go |
Renames test fixture functions. |
SKILL.md |
Adds the Drive Memory guide reference. |
Review details
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Balanced
Comment on lines
+90
to
+91
| // registerCallbackWithDocumentedPanic panics if called with an empty input. | ||
| func registerCallbackWithDocumentedPanic(input string) { |
| - `.github/aw/deployment-status.md` | ||
| - `.github/aw/designer-mappings.md` | ||
| - `.github/aw/designer.md` | ||
| - `.github/aw/drive-memory.md` |
Contributor
|
🎉 This pull request is included in a new release. Release: |
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.
The automated function-namer analysis flagged several functions in the
panic-in-library-codelinter's testdata as having names that don't clearly convey their behavior, making them harder for both humans and AI agents to search and understand.Changes
pkg/linters/panic-in-library-code/testdata/src/panicinlibrarycode/panicinlibrarycode.goto better reflect their actual behavior:invariantCheck→panicOnNegativeInvariantdocumentedPreconditionPanics→panicOnEmptyModePreconditionregisterDocumentedClosureThatPanics→registerCallbackWithDocumentedPanicpanicSuppressedByPreviousLineNolint→panicIgnoredByPreviousLineNolintpanicSuppressedBySameLineNolint→panicIgnoredBySameLineNolintDeliberately not applied
init()function was skipped. Go requires the function to remain namedinitfor the analyzer test to exercise its intended scenario (panic behavior inside a top-levelinit); renaming it would turn it into an ordinary function and invalidate that test case.