Skip to content

[prototype] Optionally check generated files#94

Open
Groxx wants to merge 1 commit into
gordonklaus:masterfrom
Groxx:generated
Open

[prototype] Optionally check generated files#94
Groxx wants to merge 1 commit into
gordonklaus:masterfrom
Groxx:generated

Conversation

@Groxx

@Groxx Groxx commented May 19, 2025

Copy link
Copy Markdown

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 :)

Comment thread ineffassign.go
Comment on lines +18 to +19

"github.com/gordonklaus/ineffassign/pkg/ineffassign"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently my goimports order is this 🤔
happy to undo if you have any preference

Comment thread ineffassign.go
flag.PrintDefaults()
ineffassign.Analyzer.Flags.PrintDefaults()
}
// maddeningly, this is how analysis/singlechecker inits its flags

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var checkGenerated bool

func init() {
// analysis/passes/findcall analyzer uses this pattern to set up flags

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gordonklaus

Copy link
Copy Markdown
Owner

It seems reasonable to me.

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.

3 participants