Skip to content
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

Duplicate rules cause directives and manually created rules to be discarded #2034

Open
kalmakazi opened this issue Feb 13, 2025 · 0 comments

Comments

@kalmakazi
Copy link

What version of gazelle are you using?

0.39.1

Does this issue reproduce with the latest releases of all the above?

Yes

What did you do?

Ran gazelle on a pkg containing a duplicate rule

What did you expect to see?

A successful run cleaning up the duplicate.

What did you see instead?

All directives and manually curated rules in the file are discarded and a corrupted graph is generated.

This is because when checkFile returns an error, the file is discarded:

func LoadData(path, pkg string, data []byte) (*File, error) {

And the only check checkFile performs is for duplicate rules:

func checkFile(f *File) error {

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

No branches or pull requests

1 participant