Looking really good...
This commit is contained in:
parent
1228491425
commit
f2f223cb23
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
from __future__ import print_function
|
||||||
from .options import OPTIONS
|
from .options import OPTIONS
|
||||||
from .option_handler import cleanup_options
|
from .option_handler import cleanup_options
|
||||||
from .reporters import print_report, print_help, print_linters
|
from .reporters import print_report, print_help, print_linters
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
from __future__ import print_function
|
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
import getopt
|
import getopt
|
||||||
|
@ -377,13 +376,12 @@ class Linters:
|
||||||
if not failed:
|
if not failed:
|
||||||
return (trimmed_filename, linter_name, 0, [])
|
return (trimmed_filename, linter_name, 0, [])
|
||||||
|
|
||||||
prefix = (((linter.get('print', 'false').strip().lower() != 'true') and ' ')
|
prefix = (((linter.get('print', 'false').strip().lower() != 'true') and ' ') or
|
||||||
or ' {}: '.format(trimmed_filename))
|
' {}: '.format(trimmed_filename))
|
||||||
output = (Linters.encode_shell_messages(prefix, out) +
|
output = (Linters.encode_shell_messages(prefix, out) +
|
||||||
((err and Linters.encode_shell_messages(prefix, err)) or []))
|
((err and Linters.encode_shell_messages(prefix, err)) or []))
|
||||||
return (trimmed_filename, linter_name, (returncode or 1), output)
|
return (trimmed_filename, linter_name, (returncode or 1), output)
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def run_one_linter(linter, filenames):
|
def run_one_linter(linter, filenames):
|
||||||
""" Runs one linter against a set of files
|
""" Runs one linter against a set of files
|
||||||
|
@ -397,7 +395,6 @@ class Linters:
|
||||||
files = set([filename for filename in filenames if match_filter(filename)])
|
files = set([filename for filename in filenames if match_filter(filename)])
|
||||||
return [Linters.run_external_linter(filename, linter.linter, linter.name) for filename in files]
|
return [Linters.run_external_linter(filename, linter.linter, linter.name) for filename in files]
|
||||||
|
|
||||||
|
|
||||||
def __call__(self):
|
def __call__(self):
|
||||||
""" Returns a function to run a set of linters against a set of filenames
|
""" Returns a function to run a set of linters against a set of filenames
|
||||||
|
|
||||||
|
@ -407,7 +404,6 @@ class Linters:
|
||||||
return reduce(operator.add,
|
return reduce(operator.add,
|
||||||
[Linters.run_one_linter(linter, self.filenames) for linter in self.linters], [])
|
[Linters.run_one_linter(linter, self.filenames) for linter in self.linters], [])
|
||||||
|
|
||||||
|
|
||||||
def dryrun(self):
|
def dryrun(self):
|
||||||
|
|
||||||
def dryrunonefile(filename, linter):
|
def dryrunonefile(filename, linter):
|
||||||
|
@ -422,7 +418,6 @@ class Linters:
|
||||||
return reduce(operator.add, [dryrunonce(linter, self.filenames) for linter in self.linters], [])
|
return reduce(operator.add, [dryrunonce(linter, self.filenames) for linter in self.linters], [])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def run_linters(options, config, extras):
|
def run_linters(options, config, extras):
|
||||||
|
|
||||||
def build_config_subset(keys):
|
def build_config_subset(keys):
|
||||||
|
|
Loading…
Reference in New Issue