From 5dce4e1d7000ab08e30ef71f874db0e40e8889b1 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 18 Apr 2015 17:06:52 +0300 Subject: Run pylint as well as pep8 on the source; fix things --- setup.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index ce0dae6..597a45b 100644 --- a/setup.py +++ b/setup.py @@ -33,12 +33,14 @@ class Check(Command): ('unit-tests', 'u', 'run unit tests?'), ('yarns', 'y', 'run yarn tests locally?'), ('pep8', '8', 'run pep8 on the source?'), + ('pylint', 'l', 'run pylint on the source?'), ] def set_all_options(self, new_value): self.unit_tests = new_value self.yarns = new_value self.pep8 = new_value + self.pylint = new_value def initialize_options(self): self.set_all_options(False) @@ -47,7 +49,8 @@ class Check(Command): any_set = ( self.unit_tests or self.yarns or - self.pep8) + self.pep8 or + self.pylint) if not any_set: self.set_all_options(True) @@ -61,6 +64,9 @@ class Check(Command): if self.pep8 and self.command_is_available('pep8'): self.run_pep8() + if self.pylint and self.command_is_available('pylint'): + self.run_pylint() + def run_unit_tests(self): cliapp.runcmd( ['python', '-m', 'CoverageTestRunner', @@ -81,6 +87,11 @@ class Check(Command): def run_pep8(self): cliapp.runcmd(['pep8', 'distixlib'], stdout=None, stderr=None) + def run_pylint(self): + cliapp.runcmd( + ['pylint', '--rcfile=pylint.conf', 'distixlib'], + stdout=None, stderr=None) + setup(name='distix', version=distixlib.version.version_string, -- cgit v1.2.1