OpenPeeDeeP / depguard

Go linter that checks if package imports are in a list of acceptable packages.
GNU General Public License v3.0
147 stars 16 forks source link

Ignore File Rules #21

Closed timkral closed 2 years ago

timkral commented 2 years ago

Hi @dixonwille ,

I'm very interested in using your linter (thank you for writing it), however, I have a use case in which I want to apply package import checks to only a portion of my code base. So I've introduced a new concept which allows a user to write rules to ignore files considered by the linter.

The syntax and semantics of the rules is very nearly the same as those for the package import checks (i.e. string prefixes and string glob patterns). However, there is a small caveat in which the rules have special syntax which allows for negation. I provided examples and a description of this in the README.

You'll also find that I added a number of tests to check the new functionality and avoid regressions. I'm pretty confident that these changes are backwards compatible and include no regression to existing functionality.

Let me know what you think and if there are any other changes that are needed.

Thanks. -Tim

dixonwille commented 2 years ago

Thanks for the PR! I'll check it out as soon as I can.

timkral commented 2 years ago

Hi @dixonwille ,

Just wanted to check in to see if you'd gotten a chance to take a look at this. Thanks again!

-Tim

timkral commented 2 years ago

@dixonwille ,

Thank you! Do you think we could publish a new version of the linter (I assume v1.1.0)? I actually am planning on using it in golangci-lint. If you publish the version, I can take care of updating the configuration in golangci-lint and will tag you for review.

Thanks again. -Tim

dixonwille commented 2 years ago

@timkral done.