Skip to content

Commit

Permalink
XMLBear: Process error correctly
Browse files Browse the repository at this point in the history
Errors were shown as logs instead of errors. Corrected the processing of
output to show the error messages.

Fixes #251
  • Loading branch information
vivek425ster committed Mar 18, 2016
1 parent a5cbf07 commit c92d09b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bears/xml/XMLBear.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ class XMLBear(LocalBear, Lint):
diff_message = "XML can be formatted better."
output_regex = r'(.*\.xml):(?P<line>\d+): (?P<message>.*)\n.*\n.*'
gives_corrected = True
use_stderr = True

def process_output(self, output, filename, file):
if self.stderr_output:
return self._process_issues(self.stderr_output, filename)
if self.stdout_output: # only yield Result if stdout is not empty
return self._process_corrected(self.stdout_output, filename, file)
if self.stderr_output: # pragma: no cover
return self._process_issues(self.stderr_output, filename)

def run(self, filename, file,
xml_schema: path="",
Expand Down

0 comments on commit c92d09b

Please sign in to comment.