Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/pax-utils:master commit in: /
Date: Wed, 28 Sep 2022 07:43:00
Message-Id: 1664350937.30d1f02c1482ea5371ee4e0a36276ae03b186208.vapier@gentoo
1 commit: 30d1f02c1482ea5371ee4e0a36276ae03b186208
2 Author: Mike Frysinger <vapier <AT> chromium <DOT> org>
3 AuthorDate: Wed Sep 28 07:40:48 2022 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 28 07:42:17 2022 +0000
6 URL: https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=30d1f02c
7
8 pylint: reformat with black
9
10 Also drop a few Python 2 specific things.
11
12 Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>
13
14 pylint | 19 ++++++++-----------
15 1 file changed, 8 insertions(+), 11 deletions(-)
16
17 diff --git a/pylint b/pylint
18 index 38d77a2..463dc03 100755
19 --- a/pylint
20 +++ b/pylint
21 @@ -1,12 +1,9 @@
22 #!/usr/bin/env python
23 -# -*- coding: utf-8 -*-
24 # Copyright 1999-2020 Gentoo Foundation
25 # Distributed under the terms of the GNU General Public License v2
26
27 """Run pylint with the right settings."""
28
29 -from __future__ import print_function
30 -
31 import os
32 import sys
33
34 @@ -17,10 +14,10 @@ def find_all_modules(source_root):
35
36 for root, _dirs, files in os.walk(source_root, topdown=False):
37 # Add all of the .py modules in the tree.
38 - ret += [os.path.join(root, x) for x in files if x.endswith('.py')]
39 + ret += [os.path.join(root, x) for x in files if x.endswith(".py")]
40
41 # Add the main scripts that don't end in .py.
42 - ret += [os.path.join(source_root, x) for x in ('pylint',)]
43 + ret += [os.path.join(source_root, x) for x in ("pylint",)]
44
45 return ret
46
47 @@ -33,17 +30,17 @@ def main(argv):
48 argv = find_all_modules(source_root)
49
50 pympath = source_root
51 - pythonpath = os.environ.get('PYTHONPATH')
52 + pythonpath = os.environ.get("PYTHONPATH")
53 if pythonpath is None:
54 pythonpath = pympath
55 else:
56 - pythonpath = pympath + ':' + pythonpath
57 - os.environ['PYTHONPATH'] = pythonpath
58 + pythonpath = pympath + ":" + pythonpath
59 + os.environ["PYTHONPATH"] = pythonpath
60
61 - pylintrc = os.path.join(source_root, '.pylintrc')
62 - cmd = ['pylint', '--rcfile', pylintrc]
63 + pylintrc = os.path.join(source_root, ".pylintrc")
64 + cmd = ["pylint", "--rcfile", pylintrc]
65 os.execvp(cmd[0], cmd + argv)
66
67
68 -if __name__ == '__main__':
69 +if __name__ == "__main__":
70 sys.exit(main(sys.argv[1:]))