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

CheckstyleBear: Load google and sun rules from jar #1036

Merged
merged 1 commit into from
Nov 22, 2016

Conversation

jayvdb
Copy link
Member

@jayvdb jayvdb commented Nov 21, 2016

The google and sun rules are provided in the jar,
and those rules are known to be compatible with the jar version.

Fixes #1017
Fixes #1034

@gitmate-bot
Copy link
Collaborator

Thanks for your contribution!

Reviewing pull requests take really a lot of time and we're all volunteers. Please make sure you go through the following check list and complete them all before pinging someone for a review.

As you learn things over your Pull Request please help others on the chat and on PRs to get their stuff right as well!

@@ -2,13 +2,20 @@
from coalib.settings.Setting import path


known_checkstyles = {
_checkstyle_provided_styles = {
# google: since version 6.9
Copy link
Member Author

Choose a reason for hiding this comment

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

sun was also 6.9 - im investigating when sun was first added.

@jayvdb jayvdb force-pushed the use-checkstyle-jar-xml branch 2 times, most recently from f1e20fc to 302a0da Compare November 21, 2016 18:32
@@ -75,9 +82,13 @@ def create_arguments(
check_invalid_configuration(
checkstyle_configs, use_spaces, indent_size)

if checkstyle_configs in known_checkstyles:
if checkstyle_configs in _checkstyle_provided_styles:
Copy link
Member Author

@jayvdb jayvdb Nov 22, 2016

Choose a reason for hiding this comment

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

hmm. this could be just

    if checkstyle_configs in ('google', 'sun'):
        checkstyle_configs = '/%s_checks.xml' % checkstyle_configs`

Copy link
Member

Choose a reason for hiding this comment

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

but doing it this way makes it easier to update the dictionaries if checkstyle gets updated no?

Copy link
Member Author

Choose a reason for hiding this comment

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

We can expect future jar to contain these ruleset XML files.
I assume they test against these rulesets, so we should trust them.
If they disappear, we'll find another solution.

@jayvdb jayvdb force-pushed the use-checkstyle-jar-xml branch from 302a0da to 5c248fd Compare November 22, 2016 04:06
Copy link
Member

@Mixih Mixih left a comment

Choose a reason for hiding this comment

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

Looks good. Just a comment.

self.section["checkstyle_configs"] = "google"
self.check_validity(self.uut, [], self.good_file)

def test_style_sun(self):
self.section["checkstyle_configs"] = "google"
Copy link
Member

Choose a reason for hiding this comment

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

def test_style_sun(self):
   self.section["checkstyle_configs"] = "google"

shouldn't "google" be "sun"?

@jayvdb jayvdb force-pushed the use-checkstyle-jar-xml branch from 5c248fd to 9b86d14 Compare November 22, 2016 06:38
The google and sun ruleset have been provided in the
checkstyle jar since version 6.2.

Load the rulesets from the linter jar so the rules
are known to be compatible with the linter version.

Fixes coala#1017
Fixes coala#1034
@sils
Copy link
Member

sils commented Nov 22, 2016

ack 9b86d14

@sils
Copy link
Member

sils commented Nov 22, 2016

@rultor merge

@rultor
Copy link

rultor commented Nov 22, 2016

@rultor merge

@sils OK, I'll try to merge now. You can check the progress of the merge here

@rultor rultor merged commit 9b86d14 into coala:master Nov 22, 2016
@rultor
Copy link

rultor commented Nov 22, 2016

@rultor merge

@sils Done! FYI, the full log is here (took me 1min)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants