Skip to content

Allow rules string as a configuration alternative #19

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

Merged
merged 6 commits into from
Sep 25, 2017
Merged

Conversation

filipesperandio
Copy link
Contributor

@filipesperandio filipesperandio commented Sep 25, 2017

pmd:
  enabled: true
  config:
    rules:
      - "java-basic"
      - "java-design"

"enabled": true,
"channel": "beta",
"config": {
"rules": "java-basic,java-design"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why this isn't an array (instead of a string with a comma-separated list)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I am stupid I guess... =/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha, no way! 😛

Just a suggestion to simplify parsing. 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually we just forward the entire thing, I think that was the reason I didn't bother to split, but I makes more sense from a yml perspective to have it as an array.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@toddmazierski Adjusted.

@Test
public void acceptRulesSimpleNames() {
def config = new Config([configFile: "/usr/src/app/fixtures/rules/config.json", codeFolder: "/usr/src/app/fixtures/rules"])
assertEquals "java-basic,java-design", config.ruleSet()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this assertion be adjusted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the argument for the command line, should still be a single string.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, my mistake.

Should config.mix.json still contain a comma-separated string, though?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not impact, but it should be adjusted. 👍

Copy link

@toddmazierski toddmazierski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@filipesperandio filipesperandio merged commit a427807 into master Sep 25, 2017
@filipesperandio filipesperandio deleted the fe/rules2 branch September 25, 2017 21:04
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

Successfully merging this pull request may close these issues.

3 participants