Skip to content

Commit

Permalink
Fixes to message level handling
Browse files Browse the repository at this point in the history
- output message level in lower case as expected by flymake.el
- customized lint tools' message levels
  • Loading branch information
Antti Kaihola committed Feb 25, 2010
1 parent 4f27b15 commit ecf6f18
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pyflymake.py
Expand Up @@ -114,12 +114,12 @@ class PylintRunner(LintRunner):
"R0201", # Method could be a function
])

fixup_map = {'E': 'error', 'C': 'info', None: 'warning'}

@staticmethod
def fixup_data(data):
if data['error_type'].startswith('E'):
data['level'] = 'ERROR'
else:
data['level'] = 'WARNING'
fixup_map = PylintRunner.fixup_map
data['level'] = fixup_map.get(data['error_type'][0], fixup_map[None])
return data

@property
Expand Down Expand Up @@ -148,7 +148,7 @@ class PycheckerRunner(LintRunner):
@staticmethod
def fixup_data(data):
#XXX: doesn't seem to give the level
data['level'] = 'WARNING'
data['level'] = 'warning'
return data

@property
Expand Down Expand Up @@ -179,9 +179,9 @@ class Pep8Runner(LintRunner):
@staticmethod
def fixup_data(data):
if 'W' in data['error_number']:
data['level'] = 'WARNING'
data['level'] = 'info'
else:
data['level'] = 'ERROR'
data['level'] = 'info'

return data

Expand Down

0 comments on commit ecf6f18

Please sign in to comment.