-
Notifications
You must be signed in to change notification settings - Fork 581
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
Conversation
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 |
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.
sun was also 6.9 - im investigating when sun was first added.
f1e20fc
to
302a0da
Compare
@@ -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: |
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.
hmm. this could be just
if checkstyle_configs in ('google', 'sun'):
checkstyle_configs = '/%s_checks.xml' % checkstyle_configs`
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.
but doing it this way makes it easier to update the dictionaries if checkstyle gets updated no?
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.
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.
302a0da
to
5c248fd
Compare
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.
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" |
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.
def test_style_sun(self):
self.section["checkstyle_configs"] = "google"
shouldn't "google"
be "sun"
?
5c248fd
to
9b86d14
Compare
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
ack 9b86d14 |
@rultor merge |
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