Skip to content

Rename testdata functions in panic-in-library-code linter for clarity - #55090

Merged
pelikhan merged 2 commits into
mainfrom
copilot/function-namer-rename-plan
Aug 23, 2026
Merged

pelikhan merged 2 commits into
mainfrom
copilot/function-namer-rename-plan

Conversation

Copilot AI commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

The automated function-namer analysis flagged several functions in the panic-in-library-code linter'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

  • Renamed functions in pkg/linters/panic-in-library-code/testdata/src/panicinlibrarycode/panicinlibrarycode.go to better reflect their actual behavior:
    • invariantCheck → panicOnNegativeInvariant
    • documentedPreconditionPanics → panicOnEmptyModePrecondition
    • registerDocumentedClosureThatPanics → registerCallbackWithDocumentedPanic
    • panicSuppressedByPreviousLineNolint → panicIgnoredByPreviousLineNolint
    • panicSuppressedBySameLineNolint → panicIgnoredBySameLineNolint

Deliberately not applied

  • The suggested rename of the second init() function was skipped. Go requires the function to remain named init for the analyzer test to exercise its intended scenario (panic behavior inside a top-level init); renaming it would turn it into an ordinary function and invalidate that test case.

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
Copilot AI requested a review from pelikhan August 23, 2026 14:22
@pelikhan
pelikhan marked this pull request as ready for review August 23, 2026 14:25
Copilot AI balanced review requested due to automatic review settings August 23, 2026 14:25
@pelikhan
pelikhan merged commit 3b17747 into main Aug 23, 2026
@pelikhan
pelikhan deleted the copilot/function-namer-rename-plan branch August 23, 2026 14:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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`
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.87.5

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.

[function-namer] Go function rename plan: pkg/linters/panic-in-library-code/testdata/src/panicinlibrarycode

3 participants