Skip to content

feat: Clear analysis cache when running custom command #5894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

k-omotani
Copy link

Overview

This PR adds automatic cache clearing when running the custom command to prevent outdated cache results from affecting the behavior.

Changes

  • Added cache directory removal in the runE method of custom.go
  • Added appropriate log messages for successful/failed cache clearing

Reason

When using the custom command, the linter itself is being modified with custom plugins or configurations. In this scenario, previously cached analysis results become invalid and can lead to incorrect linting results or unexpected behavior.

By ensuring a fresh start with a clean cache directory for each custom build, we guarantee that the analysis results accurately reflect the current state of the modified linter, providing more consistent and reliable results.

This change ensures that the custom build of golangci-lint always starts with
a clean cache by removing the cache directory before building. This prevents
potential issues where stale cached analysis results might affect the custom
build's behavior.
@CLAassistant
Copy link

CLAassistant commented Jun 25, 2025

CLA assistant check
All committers have signed the CLA.

Copy link

boring-cyborg bot commented Jun 25, 2025

Hey, thank you for opening your first Pull Request !

@ldez ldez self-requested a review June 25, 2025 09:37
@ldez ldez closed this Jun 25, 2025
@ldez ldez added the declined label Jun 25, 2025
@ldez
Copy link
Member

ldez commented Jun 25, 2025

The custom command doesn't run the analysis; this is a build command.

If you have a real problem, open an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants