Conversation
cffls
reviewed
Apr 23, 2026
| flag.IntVar(&cfg.FunctionSizeThreshold, "function-size-threshold", 50, "Maximum lines per function") | ||
| flag.IntVar(&cfg.FileSizeThreshold, "file-size-threshold", 500, "Maximum lines per file") | ||
| flag.BoolVar(&cfg.SkipMutation, "skip-mutation", false, "Skip mutation testing") | ||
| flag.BoolVar(&cfg.SkipGenerated, "skip-generated", false, "Skip files marked as generated (for example `Code generated ... DO NOT EDIT`)") |
Collaborator
There was a problem hiding this comment.
I think we can set the default to true. I don't think we want to evaluate the auto-generated code.
- add --skip-generated to exclude files marked Code generated ... DO NOT EDIT - apply the filter in both diff mode and --paths mode - add tests and README documentation
590d037 to
f5641c8
Compare
cffls
approved these changes
Apr 24, 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.
This PR adds a
--skip-generatedflag so diffguard can ignore auto-generated source files that include a standard banner such asCode generated ... DO NOT EDIT.When the flag is enabled, generated files are filtered out before analysis in both diff mode and
--pathsmode. That keeps generated code from affecting complexity, size, dependency, churn, or mutation results while preserving the current default behavior for existing users.It also adds tests covering generated-file detection and filtering, and updates the README with usage and CLI documentation.