Merge pull request 'fix arg naming convention' (#3) from dev into master

Reviewed-on: https://chacha.ddns.net/gitea/chacha/chacha_cicd_helper/pulls/3
new-tag:0.1.2
This commit was merged in pull request #3.
This commit is contained in:
2023-09-28 00:48:53 +02:00
2 changed files with 15 additions and 11 deletions

View File

@@ -44,27 +44,24 @@ class chacha_cicd_helper_args(Tap):
def configure(self) -> None:
"""specific arguments initializer"""
self.add_argument("-pp", "--project-path", dest="projectpath", help="path of the python project to process", default=os.getcwd())
self.add_argument("-pp", "--projectpath", help="path of the python project to process", default=os.getcwd())
self.add_argument("-tc", "--type-check", dest="typecheck", action="store_true", help="enable static typing check")
self.add_argument("-tc", "--typecheck", action="store_true", help="enable static typing check")
self.add_argument("-ut", "--unit-test", dest="unittest", action="store_true", help="enable unit-test")
self.add_argument("-ut", "--unittest", action="store_true", help="enable unit-test")
self.add_argument(
"-cc",
"--coverage-check",
dest="coveragecheck",
"--coveragecheck",
action="store_true",
help="enable unit-test coverage check (requires unit-test)",
)
self.add_argument("-qc", "--quality-check", dest="qualitycheck", action="store_true", help="enable code quality check")
self.add_argument("-qc", "--qualitycheck", action="store_true", help="enable code quality check")
self.add_argument("-dg", "--doc-gen", dest="docgen", action="store_true", help="enable documentation generation using MkDoc")
self.add_argument(
"-pdf", "--doc-gen-pdf", dest="docgenpdf", action="store_true", help="enable pdf documentation export (requires doc-gen)"
)
self.add_argument("-dg", "--docgen", action="store_true", help="enable documentation generation using MkDoc")
self.add_argument("-pdf", "--docgenpdf", action="store_true", help="enable pdf documentation export (requires doc-gen)")
self.add_argument("-cpc", "--complexity-check", dest="complexitycheck", action="store_true", help="enable complexity check")
self.add_argument("-cpc", "--complexitycheck", action="store_true", help="enable complexity check")
def fct_main(i_args: list[str]) -> None: # pylint: disable=too-complex

View File

@@ -35,3 +35,10 @@ class Test_main(unittest.TestCase):
fct_main(["-h", "-pp", str(testdir_path.parent.resolve())])
self.assertIn(f"usage: {chacha_cicd_helper.__Name__}", capted_stdout.getvalue())
self.assertEqual(capted_stderr.getvalue(), "")
@unittest.skip
def test_help_print(self):
with redirect_stdout(StringIO()) as capted_stdout, redirect_stderr(StringIO()) as capted_stderr:
with self.assertRaises(SystemExit):
fct_main(["-h", "-pp", str(testdir_path.parent.resolve())])
print(capted_stdout.getvalue())