Skip to content

[linter-miner] Add sortbasicslices linter for sort.Strings/Ints/Float64s #76288

Done

Description

@github-actions

Tip

Your pull request is ready to create! 🎉 ✅

Everything is OK—the changes have been pushed to a branch. Please review the protected files, then create the pull request when you are ready.

Create the pull request

The original pull request description is below.


Summary

Adds the sortbasicslices custom linter. It flags calls to sort.Strings, sort.Ints, and sort.Float64s that should use the type-safe slices.Sort from the standard library slices package.

Evidence

  • code-pattern-scanner found about 172 non-test call sites under pkg/ and cmd/. Running the linter over ./pkg/... reports 169 existing findings and 109 under ./pkg/workflow.
  • No existing analyzer covers sort.Strings/Ints/Float64s. sortslice only covers sort.Slice/SliceStable.
  • The discussion miner returned no new candidates. Several discussions were blocked by the integrity filter.

Behaviour

  • Resolves the callee through types.Info, so aliased imports (for example import s "sort") are covered.
  • Only the three named functions are flagged. sort.Sort, sort.Stable, sort.Slice, and slices.Sort are not.
  • Diagnostic only. No SuggestedFix, because the fix would also need to add the slices import.
  • Not coverage-gated, since this is a readability rule rather than a performance one.
  • Supports the standard (nolint/redacted):sortbasicslices directive.

Registration and CI

  • Registered in registry.go. Documented in README.md and doc.go, with the count updated from 93 to 94.
  • Added to notYetEnforced in doc_sync_test.go, because the existing findings need remediation before CI enforcement. CI workflow files are unchanged.

Validation

  • go test ./pkg/linters/sortbasicslices/... ./pkg/linters/ passes.
  • go build ./cmd/linters succeeds, and gofmt and go vet are clean on the new package.

Run ID: 42664143423


Note

Protected files

This patch modifies protected files, which may affect project dependencies, CI/CD pipelines, or agent behaviour.

Protected files
  • README.md

To route changes like this to a review issue instead of blocking, configure protected-files: fallback-to-issue in your workflow configuration.

Allow intentional protected-file changes

If this workflow is intended to modify these files, add specific filenames or folder prefixes to safe-outputs.create-pull-request.protected-files.exclude in the workflow Markdown frontmatter. For example, to allow .changeset/*, exclude the folder using .changeset/:

safe-outputs:
  create-pull-request:
    protected-files:
      policy: fallback-to-issue
      exclude:
        - .changeset/

Keep your existing policy and exclusions. Folder exclusions use path prefixes, not glob patterns, and allow all files beneath that folder, including subfolders. Other protected files still follow the configured policy. If allowed-files is configured, these paths must also match it. Run gh aw compile after updating the workflow.

  • expires on Nov 16, 2026, 9:52 AM UTC-08:00

Generated by Linter Miner · copilot · routed: haiku55 high · ~35 AIC · ⌖ ~2 AIC · ⊞ 4.6K · ◷

Activity

  1. github-actions commented on Nov 9, 2026

    @github-actions
    ContributorAuthor

    🍪 Issue Monster selected this for Copilot

    I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.

    If assignment succeeds, Copilot will analyze the issue and create a pull request with the fix.

    Om nom nom! 🍪

    🍪 Om nom nom by Issue Monster · pi · gpt50 · ~1 AIC · ⌖ ~2 AIC · ⊞ 11.2K · ◷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions