mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-02-19 09:43:51 +08:00
* Added pyflakes and Pylint for python * Actually run linter in CI * some simple pyflakes changes * Add flake8 to panda reqs for linter test * flake8 errors are fixed * run flake8 in regression tests * meant to run flake8 * hack to ignore unused import * bug * fix bugs in tucan_loopback * Another fix by using set_safety_mode * added pylintrc file * more fixes and enabled pylint as well * Fix pylint in circleci * added linter to readme
29 lines
754 B
Python
Executable File
29 lines
754 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import subprocess
|
|
import sys
|
|
|
|
checked_ext = ["h", "c", "py", "pyx", "cpp", "hpp", "md", "mk"]
|
|
|
|
if __name__ == "__main__":
|
|
with open("list.txt", 'r') as handle:
|
|
|
|
suffix_cmd = " "
|
|
for i in checked_ext:
|
|
suffix_cmd += "--include \*." + i + " "
|
|
|
|
found_bad_language = False
|
|
for line in handle:
|
|
line = line.rstrip('\n').rstrip(" ")
|
|
try:
|
|
cmd = "cd ../../; grep -R -i -w " + suffix_cmd + " '" + line + "'"
|
|
res = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
|
|
print(res)
|
|
found_bad_language = True
|
|
except subprocess.CalledProcessError:
|
|
pass
|
|
if found_bad_language:
|
|
sys.exit("Failed: found bad language")
|
|
else:
|
|
print("Success")
|