commit: b9b5dc7dd1da1a659bc6987665e16c904d0271a9 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> AuthorDate: Tue Feb 28 09:05:21 2023 +0000 Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> CommitDate: Wed Mar 1 18:36:10 2023 +0000 URL: https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=b9b5dc7d
scan: Replace NOCOLOR by NO_COLOR NO_COLOR is an informal standard that is followed by many programs, see https://no-color.org/. Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org> Closes: https://bugs.gentoo.org/898230 Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org> 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
