[prototype] Optionally check generated files#94
Open
Groxx wants to merge 1 commit into
Open
Conversation
Groxx
commented
May 19, 2025
Comment on lines
+18
to
+19
|
|
||
| "github.com/gordonklaus/ineffassign/pkg/ineffassign" |
Author
There was a problem hiding this comment.
apparently my goimports order is this 🤔
happy to undo if you have any preference
Groxx
commented
May 19, 2025
| flag.PrintDefaults() | ||
| ineffassign.Analyzer.Flags.PrintDefaults() | ||
| } | ||
| // maddeningly, this is how analysis/singlechecker inits its flags |
Author
There was a problem hiding this comment.
singlechecker passes all analyzers to this code: https://cs.opensource.google/go/x/tools/+/refs/tags/v0.33.0:go/analysis/internal/analysisflags/flags.go;l=59-67
Groxx
commented
May 19, 2025
| var checkGenerated bool | ||
|
|
||
| func init() { | ||
| // analysis/passes/findcall analyzer uses this pattern to set up flags |
Author
There was a problem hiding this comment.
Owner
|
It seems reasonable to me. |
scutuatua-crypto
approved these changes
Feb 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Greetings!
We recently had some problematic code custom-generated, and noticed that generated files are always ignored by this.
As largely just a proof-of-concept to kick off discussion, I hacked up this PR to add an optional CLI flag to include generated files.
How does this PR look as a general question? E.g. does it seem like something you'd consider merging, if it were "finished"? Or no?
I have roughly zero opinion on code-style, this is mostly just from checking how the analysis repo does things and mimicking it - more than happy to make changes :)