Skip to content

Commit

Permalink
CheckstyleBear: Detect errors
Browse files Browse the repository at this point in the history
Since 9227382, errors from checkstyle were ignored.

Fixes coala#1464
  • Loading branch information
jayvdb committed Feb 27, 2017
1 parent 468e2d2 commit 3ff65c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bears/java/CheckstyleBear.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)\].*?'
r'(?P<line>\d+):?(?P<column>\d+)?. '
r'(?P<message>.*?) *\[(?P<origin>[a-zA-Z]+?)\]')
class CheckstyleBear:
Expand Down
10 changes: 5 additions & 5 deletions tests/java/CheckstyleBearTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,24 @@ def setUp(self):
self.empty_config = os.path.join(test_files,
'checkstyle_empty_config.xml')

def test_run(self):
self.check_validity(self.uut, [], self.good_file)
self.check_validity(self.uut, [], self.bad_file, valid=False)

def test_style_google(self):
self.section['checkstyle_configs'] = 'google'
self.check_validity(self.uut, [], self.good_file)
self.check_validity(self.uut, [], self.bad_file, valid=False)

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)
self.check_validity(self.uut, [], self.bad_file, valid=False)

def test_style_android(self):
self.section['checkstyle_configs'] = 'android-check-easy'
self.check_validity(self.uut, [], self.good_file)
self.check_validity(self.uut, [], self.bad_file, valid=False)

self.section['checkstyle_configs'] = 'android-check-hard'
self.check_validity(self.uut, [], self.good_file)
self.check_validity(self.uut, [], self.bad_file, valid=False)

def test_config_failure_use_spaces(self):
self.section['checkstyle_configs'] = 'google'
Expand Down

0 comments on commit 3ff65c0

Please sign in to comment.