Files
30-seconds-of-code/scripts/lint.py
Rohit Tanwar 5b7baf43f8 Fix some bugs
Change lint.py to print the name of file being linted for easy debugging. Also removed a bug from website\main.py
2018-04-12 17:46:30 +05:30

10 lines
568 B
Python

import util
import subprocess
import sys
for snippet in util.read_snippets():
print(snippet.name)
code = snippet.read_code()
check_1 = subprocess.run(['flake8', '-','--select=E901,E999,F821,F822,F823','--count','--show-source','--statistics'], input=code, encoding='utf8',stdout=subprocess.PIPE)
check_2 = subprocess.run(['flake8', '-','--exit-zero','--max-complexity=10','--count','--max-line-length=127','--statistics','--ignore=W292'], input=code, encoding='utf8',stdout=subprocess.PIPE)
check_1.check_returncode()
check_2.check_returncode()