Skip to content

ci: enforce goroutinemissingrecover and trimleftright in lint gate - #49783

Merged
pelikhan merged 2 commits into
mainfrom
copilot/add-goroutinemissingrecover-analyzer
Aug 2, 2026
Merged

ci: enforce goroutinemissingrecover and trimleftright in lint gate#49783
pelikhan merged 2 commits into
mainfrom
copilot/add-goroutinemissingrecover-analyzer

Conversation

Copilot AI commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Two custom analyzers verified clean against the full codebase are promoted from non-enforced to CI-gated.

Changes

  • .github/workflows/cgo.yml: Added -goroutinemissingrecover and -trimleftright to LINTER_FLAGS in both the default-build gate and the GOOS=js GOARCH=wasm gate, following the same pattern as the previous enforce-readiness batch (appendoneelement, timenowsub, stringsjoinone).

Analyzers

  • goroutinemissingrecover — flags go func() { ... }() bodies missing a top-level defer+recover() guard; uses type-resolved builtin detection to avoid false positives from shadowed recover identifiers.
  • trimleftright — flags strings.TrimLeft/TrimRight calls with multi-character literal cutsets that look like accidental TrimPrefix/TrimSuffix misuse; single-rune and whitespace/separator character-class cutsets are correctly exempted.

Zero violations found across all enforced packages (./cmd/... ./pkg/... and the wasm subset).

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add goroutinemissingrecover analyzer to CI gate ci: enforce goroutinemissingrecover and trimleftright in lint gate Aug 2, 2026
Copilot AI requested a review from pelikhan August 2, 2026 13:16
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Great work! 🎯 This PR looks ready to go. You've cleanly promoted two custom analyzers (goroutinemissingrecover and trimleftright) from non-enforced to CI-gated status with clear, minimal changes to .github/workflows/cgo.yml. The description is thorough—documenting both analyzers, their purpose, and verification that zero violations exist across the codebase. The diff is focused and follows the established pattern from prior analyzer enforcement batches. This is exactly the kind of precision we look for in linter gate changes. ✨

Generated by ✅ Contribution Check · auto · 49 AIC · ⌖ 4.83 AIC · ⊞ 8.8K ·

@pelikhan
pelikhan marked this pull request as ready for review August 2, 2026 13:26
Copilot AI review requested due to automatic review settings August 2, 2026 13:26
@pelikhan
pelikhan merged commit d662438 into main Aug 2, 2026
@pelikhan
pelikhan deleted the copilot/add-goroutinemissingrecover-analyzer branch August 2, 2026 13:26

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

Promotes two custom Go analyzers into the CI lint gate.

Changes:

  • Enforces goroutinemissingrecover and trimleftright.
  • Applies both analyzers to default and WebAssembly lint jobs.
Show a summary per file
File Description
.github/workflows/cgo.yml Adds both analyzer flags to CI lint commands.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread .github/workflows/cgo.yml
# Note: -test=false intentionally scopes this gate to production code only.
- name: Run custom linters
run: make golint-custom LINTER_FLAGS="-errstringmatch -panicinlibrarycode -manualmutexunlock -osexitinlibrary -rawloginlib -logfatallibrary -regexpcompileinfunction -fprintlnsprintf -strconvparseignorederror -jsonmarshalignoredeerror -uncheckedtypeassertion -fmterrorfnoverbs -tolowerequalfold -httpnoctx -timeafterleak -errortypeassertion -execcommandwithoutcontext -sprintfint -stringsindexcontains -stringscountcontains -bytesbufferstring -ioutildeprecated -mapclearloop -mapdeletecheck -sprintfbool -appendoneelement -timenowsub -stringsjoinone -writebytestring -lenstringsplit -stringreplaceminusone -osgetenvlibrary -ossetenvlibrary -stringsindexhasprefix -contextcancelnotdeferred -wgdonenotdeferred -test=false"
run: make golint-custom LINTER_FLAGS="-errstringmatch -panicinlibrarycode -manualmutexunlock -osexitinlibrary -rawloginlib -logfatallibrary -regexpcompileinfunction -fprintlnsprintf -strconvparseignorederror -jsonmarshalignoredeerror -uncheckedtypeassertion -fmterrorfnoverbs -tolowerequalfold -httpnoctx -timeafterleak -errortypeassertion -execcommandwithoutcontext -sprintfint -stringsindexcontains -stringscountcontains -bytesbufferstring -ioutildeprecated -mapclearloop -mapdeletecheck -sprintfbool -appendoneelement -timenowsub -stringsjoinone -writebytestring -lenstringsplit -stringreplaceminusone -osgetenvlibrary -ossetenvlibrary -stringsindexhasprefix -contextcancelnotdeferred -wgdonenotdeferred -goroutinemissingrecover -trimleftright -test=false"
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.

Enforce-readiness: goroutinemissingrecover and trimleftright are clean, type/AST-resolved, zero production violations

3 participants