Przeglądaj źródła

added pylint to lint command and dev requirements list

Prateek93a 3 lat temu
rodzic
commit
6f4c377ff8
2 zmienionych plików z 13 dodań i 8 usunięć
  1. 1 0
      requirements/dev.txt
  2. 12 8
      setup.py

+ 1 - 0
requirements/dev.txt

@@ -1,4 +1,5 @@
 # Contains development specific requirements and imports common requirements
 flake8==3.9.2
+pylint==2.8.2
 pre-commit==2.13.0
 -r common.txt

+ 12 - 8
setup.py

@@ -23,14 +23,18 @@ class Lint(Command):
         pass
 
     def run(self):
-        try:
-            command = ['flake8', '--config=.flake8rc', '.']
-            subprocess.check_call(command)
-            print('No lint errors found')
-        except FileNotFoundError:
-            print('flake8 not installed')
-        except subprocess.CalledProcessError:
-            pass
+        commands = {'Flake8': 'flake8 --config=.flake8rc .'.split(),
+                    'Pylint': 'pylint --rcfile=.pylintrc howdoi'.split()}
+
+        for linter, command in commands.items():
+            try:
+                print(f'\nRunning {linter}...')
+                subprocess.check_call(command)
+                print(f'No lint errors found by {linter}')
+            except FileNotFoundError:
+                print(f'{linter} not installed')
+            except subprocess.CalledProcessError:
+                pass
 
 
 def read(*names):