-
Notifications
You must be signed in to change notification settings - Fork 55
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
Ignore packages #12
Ignore packages #12
Conversation
This allows the configuration of packages to ignore. This is useful in situations where some code is being generated by another tool or plugin, and the generated code contains violations. A good example is the code generated by JavaCC. Signed-off-by: Julien Ponge <[email protected]>
if (path.endsWith(".class")) { | ||
if (ignorePackages != null) { | ||
for (String ignoredPrefix : ignorePackages) { | ||
if (path.replace(File.separatorChar, '.').contains(ignoredPrefix)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of filtering package names in the Mojo, perhaps Modernizer.check
should do this? One approach would be to use ClassReader.getClassName
.
@jponge This seems like a good feature although can you investigate my proposed alternative implementation? Also can you address the Checkstyle violations? I will configure CloudBees for this repository to automate this in the future. Thanks! |
Haven't much time, but I'll try to get back to that PR one of these days 😄 |
Adding this functionality to |
4817d32
to
5c7190b
Compare
Thanks Andrew. Sorry I didn't have the time to work further on it. On Mon, Dec 15, 2014, at 13:19, Andrew Gaul wrote:
|
This feature is really cool. Any idea when you will release? |
@ArloL I will run another release this week including this fix. |
@ArloL Released 1.2.0 to Maven Central. |
Cool, thanks! |
Note that this commit introduced a regression #17. |
This feature allows ignoring some package prefixes.
This is useful when dealing with generated code.