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: Detect errors #1527

Merged
merged 1 commit into from
Mar 29, 2017
Merged

CheckstyleBear: Detect errors #1527

merged 1 commit into from
Mar 29, 2017

Conversation

jayvdb
Copy link
Member

@jayvdb jayvdb commented Mar 21, 2017

Since 9227382, errors from checkstyle were ignored.

Also set java files to be native EOL in .gitattributes,
to match default EOL expected by Checkstyle rule
NewlineAtEndOfFile.

Fixes #1464

# Force DOS format, as Checkstyle configs enable NewlineAtEndOfFile,
# which defaults to CRLF on Windows, and Appveyor CI ignores .gitattributes
# http://help.appveyor.com/discussions/problems/5687-gitattributes-changes-dont-have-any-effect
- unix2dos tests/java/test_files/CheckstyleGood.java
Copy link
Member

Choose a reason for hiding this comment

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

let's do this with the bad file as well so we see the differences between the configs.

Copy link
Member Author

Choose a reason for hiding this comment

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

I dont object to doing that; certainly makes sense.

However pushing back a little bit, and only a little bit, this line fixes one problem occurring in test_style_android, and it occurs only on Windows. The bad files already fail, for other reasons, and fail on unix, so the only thing which more unix2dos would find is more Windows specific issues wrt checkstyle.

When I upgraded to Checkstyle 7.6 (#1466), there are three failed method - test_style_sun and test_style_google also fail on Appveyor and not on Travis/Circle , so there are more Windows specific problems somewhere in there, which will be found in the next set of patches for CheckstyleBear.

Copy link
Member Author

Choose a reason for hiding this comment

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

@@ -33,7 +33,7 @@ def known_checkstyle_or_path(setting):

@linter(executable='java',
output_format='regex',
output_regex=r'\[(?P<severity>WARN|INFO)\].*?'
output_regex=r'\[(?P<severity>WARN|INFO|ERROR)\].*?'
Copy link
Member

Choose a reason for hiding this comment

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

Small thing:
Why not order it info warn error?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. It seems (git grep '<severity>') ERROR|WARN|INFO would be the more common ordering.

@jayvdb jayvdb force-pushed the checkstyle-ERROR branch 2 times, most recently from f63088a to 0d4d895 Compare March 23, 2017 21:26

def test_style_sun(self):
self.section['checkstyle_configs'] = 'sun'
self.check_validity(self.uut, [], self.good_file)
self.check_validity(self.uut, [], self.good_file, valid=False)
Copy link
Member

Choose a reason for hiding this comment

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

valid=False? Is that non-Sun-compliant?

Copy link
Member Author

Choose a reason for hiding this comment

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

yup. I'm surprised it is compliant with any ruleset to be honest.

@Nosferatul
Copy link
Member

ack 0d4d895

@Nosferatul
Copy link
Member

needs rebase

The first commit coala/coala@9bea8fe80,
and the rewrite in 9227382, ignored ERROR from checkstyle.

Also set java files to be native EOL in .gitattributes,
to match default EOL expected by Checkstyle rule
NewlineAtEndOfFile, and force DOS EOL on AppVeyor.

Also remove `test_run` as it uses `google` by default,
which is covered in the specifically named test method.

Fixes coala#1464
@jayvdb
Copy link
Member Author

jayvdb commented Mar 29, 2017

reack d9234ef

@jayvdb
Copy link
Member Author

jayvdb commented Mar 29, 2017

@rultor merge

@rultor
Copy link

rultor commented Mar 29, 2017

@rultor merge

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

@rultor rultor merged commit d9234ef into coala:master Mar 29, 2017
@rultor
Copy link

rultor commented Mar 29, 2017

@rultor merge

@jayvdb 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.

8 participants