From: Shane Jaroch Date: Thu, 14 Dec 2023 16:53:50 +0000 (-0500) Subject: use --debug, no "-d". Update black. Changelog. X-Git-Tag: v0.2.8.dev0~53 X-Git-Url: https://git.nutra.tk/v2?a=commitdiff_plain;h=2291636d30575f47b0acd6f97ccaed7aec7f3092;p=nutratech%2Fcli.git use --debug, no "-d". Update black. Changelog. --- diff --git a/.github/workflows/install-linux.yml b/.github/workflows/install-linux.yml index d04e24a..eac988d 100644 --- a/.github/workflows/install-linux.yml +++ b/.github/workflows/install-linux.yml @@ -53,5 +53,5 @@ jobs: - name: Basic Tests / CLI / Integration run: | n --version - nutra -d recipe init -f + nutra --debug recipe init -f nutra --no-pager recipe diff --git a/.github/workflows/install-win32.yml b/.github/workflows/install-win32.yml index 646b44d..c327b6d 100644 --- a/.github/workflows/install-win32.yml +++ b/.github/workflows/install-win32.yml @@ -44,7 +44,7 @@ jobs: - name: Basic Tests / CLI / Integration run: | n --version - nutra -d init -y + nutra --debug init -y nutra --no-pager nt nutra --no-pager sort -c 789 nutra --no-pager search ultraviolet mushrooms diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 23c6b48..eae3650 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -12,6 +12,18 @@ and this project adheres to `Semantic Versioning argparse.ArgumentParser: ) arg_parser.add_argument( - "-d", "--debug", action="store_true", help="enable detailed error messages" + "--debug", action="store_true", help="enable detailed error messages" ) arg_parser.add_argument( "--no-pager", action="store_true", help="disable paging (print full output)" @@ -113,7 +113,7 @@ def main(args: list = None) -> int: # type: ignore if CLI_CONFIG.debug: raise except Exception as exception: # pylint: disable=broad-except # pragma: no cover - print("Unforeseen error, run with -d for more info: " + repr(exception)) + print("Unforeseen error, run with --debug for more info: " + repr(exception)) print("You can open an issue here: %s" % __url__) print("Or send me an email with the debug output: %s" % __email__) if CLI_CONFIG.debug: diff --git a/requirements-lint.txt b/requirements-lint.txt index b18ed43..029d811 100644 --- a/requirements-lint.txt +++ b/requirements-lint.txt @@ -1,5 +1,5 @@ bandit==1.7.6 -black==23.11.0 +black==23.12.0 doc8==1.1.1 flake8==6.1.0 mypy==1.7.1 diff --git a/tests/test_cli.py b/tests/test_cli.py index 42d8c7e..ab85c4c 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -91,7 +91,7 @@ class TestCli(unittest.TestCase): def test_300_argparser_debug_no_paging(self): """Verifies the debug and no_paging flags are set""" - args = arg_parser.parse_args(args=["-d", "--no-pager"]) + args = arg_parser.parse_args(args=["--debug", "--no-pager"]) CLI_CONFIG.set_flags(args) assert args.debug is True @@ -247,7 +247,7 @@ class TestCli(unittest.TestCase): assert result["navy"] == 10.64 # Invalid (failed Navy) - args = arg_parser.parse_args(args="-d calc bf -w 80 -n 40".split()) + args = arg_parser.parse_args(args="--debug calc bf -w 80 -n 40".split()) CLI_CONFIG.set_flags(args) code, result = args.func(args) assert code in {0, 1} # Might be a failed code one day, but returns 0 for now @@ -323,8 +323,8 @@ class TestCli(unittest.TestCase): nt_main(args=["-h"]) assert system_exit.value.code == 0 - # -d - code = nt_main(args=["-d"]) + # --debug + code = nt_main(args=["--debug"]) assert code == 0 # __main__: if args_dict @@ -342,7 +342,7 @@ class TestCli(unittest.TestCase): # TODO: replace with non-biometric test # from ntclient.services import biometrics # - # args = arg_parser.parse_args(args=["-d", "bio", "log", "add", "12,12"]) + # args = arg_parser.parse_args(args=["--debug", "bio", "log", "add", "12,12"]) # biometrics.input = ( # lambda x: "y" # ) # mocks input, could also pass `-y` flag or set yes=True @@ -395,7 +395,7 @@ class TestCli(unittest.TestCase): ) with pytest.raises(SqlInvalidVersionError) as sql_invalid_version_error: - nt_main(["-d", "nt"]) + nt_main(["--debug", "nt"]) assert sql_invalid_version_error is not None @unittest.skip(reason="Long-running test, want to replace with more 'unit' style")