def main() -> None: _ensure_requirements() # cwd is set to the project root by pre-commit. # Add it to sys.path so pylint can find the project local plugins. sys.path.insert(0, os.getcwd()) tool = sys.argv.pop(1) if tool == "pylint": from pylint import run_pylint run_pylint() elif tool == "mypy": from mypy.__main__ import console_entry console_entry() else: raise RuntimeError(f"Unsupported tool: {tool}")
#!/usr/bin/env python # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/master/COPYING import os import sys import pylint # Strip out the current working directory from sys.path. # Having the working directory in `sys.path` means that `pylint` might # inadvertently import user code from modules having the same name as # stdlib or pylint's own modules. # CPython issue: https://bugs.python.org/issue33053 if sys.path[0] == "" or sys.path[0] == os.getcwd(): sys.path.pop(0) pylint.run_pylint()
import os import sys import subprocess from pylint import run_pylint scripts_dir = os.path.dirname(os.path.abspath(__file__)) vsc_dir = os.path.dirname(scripts_dir) sys.argv = [sys.argv[0]] sys.argv.append("-E") sys.argv.append("--extension-pkg-whitelist=pyboolector") sys.argv.append("--disable=missing-super-argument") sys.argv.append("--load-plugins") sys.argv.append("vsc.pylint") sys.argv.append(os.path.join(vsc_dir, "src", "vsc")) #for f in os.listdir(os.path.join(vsc_dir, "ve", "unit")): # if f.startswith("test_"): # sys.argv.append(os.path.join(vsc_dir, "ve", "unit", f)) #for a in sys.argv: # print("Argument: " + str(a)) run_pylint() print("PyLint Complete")
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/master/COPYING #!/usr/bin/env python import pylint pylint.run_pylint()
if __name__ == '__main__': import sys import pylint sys.exit(pylint.run_pylint())
# -*- coding: utf-8 -*- import re import sys from pylint import run_pylint if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit(run_pylint())
#!/usr/bin/python3 # -*- coding: utf-8 -*- import re import sys from pylint import run_pylint if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) run_pylint() # sys.exit()