GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||
GeezerVison is showing github.com — [java] Add property to ignore interfaces in FieldDeclarationsShouldBeAtStartOfClassRule by SUPERCILEX · Pull Request #374 · pmd/pmd Conversation
|
|
The travis build passed! 😄 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Awesome! Thanks for contributing! As for building, all you'll need is maven, and follow this guide: https://github.com/pmd/pmd/blob/master/BUILDING.md As for unit testing, I'll add a test for this change and reference them here. Then you can see, how this works ;) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| "Ignore Enum Declarations that precede fields.", true, 1.0f); | ||
| private BooleanProperty ignoreAnonymousClassDeclarations = new BooleanProperty("ignoreAnonymousClassDeclarations", | ||
| "Ignore Field Declarations, that are initialized with anonymous class declarations", true, 2.0f); | ||
| private BooleanProperty ignoreInterfaceDeclarations = new BooleanProperty("ignoreInterfaceDeclarations", |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
While writing the unit test, I figured out, that one piece is missing. The properties need to be declared for the rule. This usually happens in the constructor like this:
definePropertyDescriptor(ignoreInterfaceDeclarations);
I'll add this. It's always good to have unit tests :)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
This will be part of PMD 5.7.0 And here's the unit test: 44bb282 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
One more thing: Since this now merged to master and travis has built it (or is still building), it should be included in the latest snapshot binaries You can set this property in your ruleset.xml like this: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@adangel Wow, thanks for all this great information!!! 😄 I'm glad you caught that mistake with not registering the property, and yeah, unit tests are good. 😆 I've never seen them done in XML before, so that's interesting. It looks really simple actually, you just put in some code in the cdata and tell it the number of violations you expect, is that correct? Thanks again for all your help, being able to build pmd will certainly make it easier to contribute! 😸 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
[java] FieldDeclarationsShouldBeAtStartOfClass: Add ability to ignore interfaces
There was an error while loading. Please reload this page.