• Home
  • Raw
  • Download

Lines Matching +full:pylint +full:- +full:exit

4 # # Third party dependencies.  These are only listed because pylint itself needs
8 # name: "infra/python/wheels/configparser-py2_py3"
12 # name: "infra/python/wheels/futures-py2_py3"
16 # name: "infra/python/wheels/isort-py2_py3"
24 # name: "infra/python/wheels/backports_functools_lru_cache-py2_py3"
28 # name: "infra/python/wheels/lazy-object-proxy/${vpython_platform}"
32 # name: "infra/python/wheels/singledispatch-py2_py3"
36 # name: "infra/python/wheels/enum34-py2"
40 # name: "infra/python/wheels/mccabe-py2_py3"
44 # name: "infra/python/wheels/six-py2_py3"
48 # # Pylint dependencies.
51 # name: "infra/python/wheels/astroid-py2_py3"
56 # name: "infra/python/wheels/pylint-py2_py3"
57 # version: "version:1.9.5-45a720817e4de1df2f173c7e4029e176"
62 Wrapper to patch pylint library functions to suit autotest.
65 files. It runs pylint on a list of files that it obtains either through
66 the command line or from an environment variable set in pre-upload.py.
85 # Do a basic check to see if pylint is even installed.
87 import pylint
88 from pylint import __version__ as pylint_version
90 print ("Unable to import pylint, it may need to be installed."
91 " Run 'sudo aptitude install pylint' if you haven't already.")
96 # some files make pylint blow up, so make sure we ignore them
97 SKIPLIST = ['/site-packages/*', '/contrib/*', '/frontend/afe/management.py']
100 import pylint.lint
101 from pylint.checkers import base, imports, variables
107 # need to put autotest root dir on sys.path so pylint will be happy
111 # patch up pylint import checker to handle our importing magic
114 # A list of modules for pylint to ignore, specifically, these modules
115 # are imported for their side-effects and are not meant to be used.
124 Error raised when pylint complains about a file.
141 if modname.startswith(ROOT_MODULE) or modname.startswith(ROOT_MODULE[:-1]):
151 effects. Pylint doesn't understand this and flags them as unused, since
153 to transplant said modules into the dictionary of modules pylint has
154 already seen, before pylint checks it.
156 @param to_consume: a dictionary of names pylint needs to see referenced.
157 @param consumed: a dictionary of names that pylint has seen referenced.
193 # The type of the object has changed in pylint 1.8.2
274 Run pylint on a list of files so we get consolidated errors.
277 @param base_opts: a list of pylint config options.
279 @returns pylint return code
281 @raises: pylint_error if pylint finds problems with a file
287 pylint_runner = pylint.lint.Run(list(base_opts) + list(file_paths),
288 exit=False)
297 @return: True if this file is a non-skiplisted python file.
308 Invokes pylint on files after confirming that they're not block listed.
310 @param base_opts: pylint base options.
311 @param file_path: path to the file we need to run pylint on.
313 @returns pylint return code
320 pylint_runner = pylint.lint.Run(base_opts + [file_path], exit=False)
343 @param base_opts: pylint base options.
346 @returns pylint return code
379 @param args_list: list of files/pylint args passed in through argv.
380 @param pylint_base_opts: default pylint options.
384 if args.startswith('--'):
406 output = git_repo.gitcmd('show --no-ext-diff %s:%s'
418 pylint on a temp file into which we've 'git show'n the committed version
424 @param pylint_base_opts: a list of pylint config options.
426 @returns pylint return code
439 temp_files = [os.path.join(tempdir.name, file_path.split('/')[-1:][0])
467 """Main function checks each file in a commit for pylint violations."""
476 # C0112: Non-empty Docstring needed.
479 # cleaning all the lint in it. See chromium-os:37364.
493 pylint_base_opts = ['--rcfile=%s' % pylint_rc,
494 '--reports=no',
495 '--disable=W,R,E,C,F',
496 '--enable=W0104,W0611,W1201,C0111,C0112,E0602,'
498 '--no-docstring-rgx=%s' % no_docstring_rgx,]
501 pylint_base_opts = ['--disable-msg-cat=%s' % all_failures,
502 '--reports=no',
503 '--include-ids=y',
504 '--ignore-docstrings=n',
505 '--no-docstring-rgx=%s' % no_docstring_rgx,]
530 sys.exit(ret)
533 sys.exit(1)