Skip to content

[linter-miner] Add os-remove-unchecked-cleanup analyzer #73905

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.


Overview

Adds the osremoveuncheckedcleanup analyzer, which reports bare os.Remove and os.RemoveAll calls whose errors are discarded. It uses type information to avoid same-named methods from other packages and permits explicit handling, returned errors, deferred calls, and matching nolint directives.

Evidence

The sequential mining pass found no new non-duplicate candidates in the last 14 days of issues and discussions. The Go source scan found a bare cleanup call in pkg/cli/shellcheck.go around line 277. The analyzer provides a focused diagnostic before this pattern becomes silently ignored cleanup failure.

Mining details

The discussion candidates stringssplitfirst and boolliteralcompare were excluded because those analyzers already exist. The selected rule is specific, actionable, and not an existing pkg/linters implementation.

Validation

  • go test ./pkg/linters/os-remove-unchecked-cleanup/... ./pkg/linters passed.
  • go build ./cmd/linters and a runner smoke test passed.
  • make golint-custom reached the new diagnostic and also reported existing repository violations, so the repository-wide lint target remains non-zero.
  • BASE_REF=HEAD make agent-report-progress passed impacted tests, custom linters, and schema checks; the Go lint step could not run because golangci-lint is unavailable in this runner.

Next actions

Review the analyzer and decide separately when existing cleanup findings are ready for enforcement.

References:


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.

Generated by Linter Miner · copilot · routed: gpt56 max · ~38 AIC · ⌖ ~2 AIC · ⊞ 3.7K · ◷

  • expires on Nov 8, 2026, 2:49 PM UTC-08:00

Activity

  1. github-actions commented on Nov 7, 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 · ⌖ ~1 AIC · ⊞ 12.4K · ◷

  2. linked a pull request that will close this issueAdd unchecked os cleanup analyzer #75765on Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions