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 17, 2016
1 parent a5cbf07 commit a1588aa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 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.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
if self.stderr_output:
return self._process_issues(self.stderr_output, filename)
if self.stdout_output:
return self._process_corrected(self.stdout_output, filename, file)

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

0 comments on commit a1588aa

Please sign in to comment.