Gentoo Archives: gentoo-commits

From: Arthur Zamarin <arthurzam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/pkgcore/pkgcheck:master commit in: tests/scripts/, src/pkgcheck/scripts/
Date: Wed, 01 Mar 2023 18:38:33
Message-Id: 1677695770.b9b5dc7dd1da1a659bc6987665e16c904d0271a9.arthurzam@gentoo
1 commit: b9b5dc7dd1da1a659bc6987665e16c904d0271a9
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 28 09:05:21 2023 +0000
4 Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 1 18:36:10 2023 +0000
6 URL: https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=b9b5dc7d
7
8 scan: Replace NOCOLOR by NO_COLOR
9
10 NO_COLOR is an informal standard that is followed by many programs,
11 see https://no-color.org/.
12
13 Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
14 Closes: https://bugs.gentoo.org/898230
15 Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
16
17 src/pkgcheck/scripts/pkgcheck_scan.py | 2 +-
18 tests/scripts/test_pkgcheck_scan.py | 8 ++++----
19 2 files changed, 5 insertions(+), 5 deletions(-)
20
21 diff --git a/src/pkgcheck/scripts/pkgcheck_scan.py b/src/pkgcheck/scripts/pkgcheck_scan.py
22 index b19afafb..9abfe2b5 100644
23 --- a/src/pkgcheck/scripts/pkgcheck_scan.py
24 +++ b/src/pkgcheck/scripts/pkgcheck_scan.py
25 @@ -401,7 +401,7 @@ def _setup_scan(parser, namespace, args):
26 # load repo-specific args from config if they exist
27 namespace = config_parser.parse_config_sections(namespace, namespace.target_repo.aliases)
28
29 - if os.getenv("NOCOLOR"):
30 + if os.getenv("NO_COLOR"):
31 namespace.color = False
32
33 return namespace, args
34
35 diff --git a/tests/scripts/test_pkgcheck_scan.py b/tests/scripts/test_pkgcheck_scan.py
36 index 7b1e5bdc..83ac7760 100644
37 --- a/tests/scripts/test_pkgcheck_scan.py
38 +++ b/tests/scripts/test_pkgcheck_scan.py
39 @@ -279,12 +279,12 @@ class TestPkgcheckScanParseArgs:
40 )
41
42 args = ("scan", "--config", str(config_file))
43 - with os_environ("NOCOLOR"):
44 + with os_environ("NO_COLOR"):
45 assert parser.parse_args(args).color is True
46 - with os_environ(NOCOLOR="1"):
47 - # NOCOLOR overrides config file
48 + with os_environ(NO_COLOR="1"):
49 + # NO_COLOR overrides config file
50 assert parser.parse_args(args).color is False
51 - # cmd line option overrides NOCOLOR
52 + # cmd line option overrides NO_COLOR
53 assert parser.parse_args([*args, "--color", "n"]).color is False
54 assert parser.parse_args([*args, "--color", "y"]).color is True