From 3a07bb64eb7685dc43cf015e0b4b36303ac91daa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulrich=20M=C3=BCller?= Date: Tue, 28 Feb 2023 10:05:21 +0100 Subject: [PATCH] scan: Replace NOCOLOR by NO_COLOR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NO_COLOR is an informal standard that is followed by many programs, see https://no-color.org/. Signed-off-by: Ulrich Müller --- src/pkgcheck/scripts/pkgcheck_scan.py | 2 +- tests/scripts/test_pkgcheck_scan.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pkgcheck/scripts/pkgcheck_scan.py b/src/pkgcheck/scripts/pkgcheck_scan.py index b19afafb..9abfe2b5 100644 --- a/src/pkgcheck/scripts/pkgcheck_scan.py +++ b/src/pkgcheck/scripts/pkgcheck_scan.py @@ -401,7 +401,7 @@ def _setup_scan(parser, namespace, args): # load repo-specific args from config if they exist namespace = config_parser.parse_config_sections(namespace, namespace.target_repo.aliases) - if os.getenv("NOCOLOR"): + if os.getenv("NO_COLOR"): namespace.color = False return namespace, args diff --git a/tests/scripts/test_pkgcheck_scan.py b/tests/scripts/test_pkgcheck_scan.py index 7b1e5bdc..83ac7760 100644 --- a/tests/scripts/test_pkgcheck_scan.py +++ b/tests/scripts/test_pkgcheck_scan.py @@ -279,12 +279,12 @@ class TestPkgcheckScanParseArgs: ) args = ("scan", "--config", str(config_file)) - with os_environ("NOCOLOR"): + with os_environ("NO_COLOR"): assert parser.parse_args(args).color is True - with os_environ(NOCOLOR="1"): - # NOCOLOR overrides config file + with os_environ(NO_COLOR="1"): + # NO_COLOR overrides config file assert parser.parse_args(args).color is False - # cmd line option overrides NOCOLOR + # cmd line option overrides NO_COLOR assert parser.parse_args([*args, "--color", "n"]).color is False assert parser.parse_args([*args, "--color", "y"]).color is True -- 2.39.2