Skip to content

Commit

Permalink
pylint: reformat with black
Browse files Browse the repository at this point in the history
Also drop a few Python 2 specific things.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
  • Loading branch information
vapier committed Sep 28, 2022
1 parent 1ddedd8 commit 30d1f02
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions pylint
@@ -1,12 +1,9 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2020 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

"""Run pylint with the right settings."""

from __future__ import print_function

import os
import sys

Expand All @@ -17,10 +14,10 @@ def find_all_modules(source_root):

for root, _dirs, files in os.walk(source_root, topdown=False):
# Add all of the .py modules in the tree.
ret += [os.path.join(root, x) for x in files if x.endswith('.py')]
ret += [os.path.join(root, x) for x in files if x.endswith(".py")]

# Add the main scripts that don't end in .py.
ret += [os.path.join(source_root, x) for x in ('pylint',)]
ret += [os.path.join(source_root, x) for x in ("pylint",)]

return ret

Expand All @@ -33,17 +30,17 @@ def main(argv):
argv = find_all_modules(source_root)

pympath = source_root
pythonpath = os.environ.get('PYTHONPATH')
pythonpath = os.environ.get("PYTHONPATH")
if pythonpath is None:
pythonpath = pympath
else:
pythonpath = pympath + ':' + pythonpath
os.environ['PYTHONPATH'] = pythonpath
pythonpath = pympath + ":" + pythonpath
os.environ["PYTHONPATH"] = pythonpath

pylintrc = os.path.join(source_root, '.pylintrc')
cmd = ['pylint', '--rcfile', pylintrc]
pylintrc = os.path.join(source_root, ".pylintrc")
cmd = ["pylint", "--rcfile", pylintrc]
os.execvp(cmd[0], cmd + argv)


if __name__ == '__main__':
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))

0 comments on commit 30d1f02

Please sign in to comment.