RepoAuditor 0.2.34__tar.gz → 0.2.35__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {repoauditor-0.2.34 → repoauditor-0.2.35}/.github/workflows/CICD_impl.yml +1 -1
- {repoauditor-0.2.34 → repoauditor-0.2.35}/PKG-INFO +1 -1
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/EntryPoint.py +35 -24
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/DismissStalePullRequestApprovals.py +1 -1
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireApprovalMostRecentPush.py +1 -1
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireApprovals.py +1 -1
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireCodeOwnerReview.py +1 -1
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireUpToDateBranches.py +1 -1
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/Description.py +2 -3
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/__init__.py +1 -1
- {repoauditor-0.2.34 → repoauditor-0.2.35}/tests/EntryPoint_UnitTest.py +39 -1
- repoauditor-0.2.35/tests/Plugins/GitHubModule_UnitTest.py +943 -0
- repoauditor-0.2.34/tests/Plugins/GitHubModule_UnitTest.py +0 -70
- {repoauditor-0.2.34 → repoauditor-0.2.35}/.copier-answers.yml +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/.github/CODEOWNERS +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/.github/ISSUE_TEMPLATE/custom.md +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/.github/actions/release_impl/action.yml +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/.github/pull_request_template.md +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/.github/release_sources.yaml +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/.github/workflows/CICD.yml +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/.github/workflows/EndToEnd.yml +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/.github/workflows/codeql.yml +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/.gitignore +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/.pre-commit-config.yaml +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/.python-version +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/CODE_OF_CONDUCT.md +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/CONTRIBUTING.md +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/DEVELOPMENT.md +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/GOVERNANCE.md +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/LICENSE +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/MAINTAINERS.md +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/README.md +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/SECURITY.md +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/minisign_key.pub +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/pyproject.toml +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/AutoGitSemVer.yaml +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/CommandLineProcessor.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Display.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/ExecuteModules.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Impl/ParallelSequentialProcessor.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Impl/__init__.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Module.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugin.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionQuery.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/AllowDeletions.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/AllowForcePushes.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/DoNotAllowBypassSettings.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/EnsureStatusChecks.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/ClassicEnableRequirementImpl.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/ClassicValueRequirementImpl.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/__init__.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireConversationResolution.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireLinearHistory.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequirePullRequests.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireSignedCommits.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireStatusChecksToPass.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/__init__.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/DefaultBranchQuery.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/DefaultBranchQueryRequirements/Protected.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/DefaultBranchQueryRequirements/__init__.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/Impl/Common.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/Impl/EnableRequirementImpl.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/Impl/ValueRequirementImpl.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/Impl/__init__.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/Module.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQuery.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/AutoMerge.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/DefaultBranch.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/DeleteHeadBranches.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/DependabotSecurityUpdates.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/Impl/StandardEnableRequirementImpl.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/Impl/StandardValueRequirementImpl.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/Impl/__init__.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/License.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/MergeCommit.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/MergeCommitMessage.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/Private.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/RebaseMergeCommit.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SecretScanning.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SecretScanningPushProtection.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SquashCommitMerge.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SquashMergeCommitMessage.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SuggestUpdatingPullRequestBranches.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SupportDiscussions.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SupportIssues.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SupportProjects.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SupportWikis.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/TemplateRepository.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/WebCommitSignoff.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/__init__.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHub/__init__.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHubBase/Module.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHubBase/__init__.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHubCustomization/CustomizationQuery.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHubCustomization/Impl/ExistsRequirementImpl.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHubCustomization/Impl/__init__.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHubCustomization/Module.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHubCustomization/Requirements/CodeOwners.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHubCustomization/Requirements/Contributing.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHubCustomization/Requirements/IssueTemplates.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHubCustomization/Requirements/PullRequestTemplates.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHubCustomization/Requirements/SecurityPolicy.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHubCustomization/Requirements/__init__.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHubCustomization/__init__.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHubCustomizationPlugin.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHubPlugin.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHubRulesets/Impl/EnableRulesetRequirementImpl.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHubRulesets/Impl/__init__.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHubRulesets/Module.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHubRulesets/Requirements/RequirePullRequests.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHubRulesets/Requirements/RequireSignedCommits.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHubRulesets/Requirements/RequireStatusChecks.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHubRulesets/Requirements/__init__.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHubRulesets/RulesetQuery.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHubRulesets/__init__.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/GitHubRulesetsPlugin.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Plugins/__init__.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Query.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/Requirement.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/RepoAuditor/py.typed +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/src/github_auditor/__init__.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/tests/CommandLineProcessor_UnitTest.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/tests/ExecuteModules_UnitTest.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/tests/Module_UnitTest.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/tests/Plugin_UnitTest.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/tests/Plugins/GitHubCustomization_EndToEndTest.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/tests/Plugins/GitHubCustomization_UnitTest.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/tests/Plugins/GitHubRuleset_EndToEndTest.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/tests/Plugins/GitHubRuleset_UnitTest.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/tests/Plugins/GitHub_EndToEndTest.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/tests/Plugins/__snapshots__/GitHubCustomization_EndToEndTest.ambr +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/tests/Plugins/__snapshots__/GitHubRuleset_EndToEndTest.ambr +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/tests/Plugins/__snapshots__/GitHub_EndToEndTest.ambr +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/tests/Plugins/utilities.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/tests/Query_UnitTest.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/tests/Requirement_UnitTest.py +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/tests/__snapshots__/ExecuteModules_UnitTest.ambr +0 -0
- {repoauditor-0.2.34 → repoauditor-0.2.35}/uv.lock +0 -0
|
@@ -70,7 +70,7 @@ jobs:
|
|
|
70
70
|
run: uv run pre-commit run --verbose
|
|
71
71
|
|
|
72
72
|
- name: Validate Tests
|
|
73
|
-
run: uv run pytest -k 'not EndToEndTest' --cov-fail-under=
|
|
73
|
+
run: uv run pytest -k 'not EndToEndTest' --cov-fail-under=90.0
|
|
74
74
|
env:
|
|
75
75
|
COVERAGE_FILE: .coverage.${{ matrix.os }}.${{ matrix.python_version }}
|
|
76
76
|
|
|
@@ -35,9 +35,9 @@ class NaturalOrderGrouper(TyperGroup):
|
|
|
35
35
|
"""Group commands in natural order."""
|
|
36
36
|
|
|
37
37
|
# ----------------------------------------------------------------------
|
|
38
|
-
def list_commands(self, *args, **kwargs) -> list[str]: # noqa: ARG002
|
|
38
|
+
def list_commands(self, *args, **kwargs) -> list[str]: # noqa: ARG002 # pragma: no cover
|
|
39
39
|
"""Return a list of all the commands, to be sorted in a natural ordering."""
|
|
40
|
-
return self.commands.keys()
|
|
40
|
+
return list(self.commands.keys())
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
# ----------------------------------------------------------------------
|
|
@@ -64,31 +64,42 @@ _all_modules = _GetModules()
|
|
|
64
64
|
del _GetModules
|
|
65
65
|
|
|
66
66
|
|
|
67
|
+
# ----------------------------------------------------------------------
|
|
68
|
+
def TypeInfoToString(
|
|
69
|
+
arg_name: str,
|
|
70
|
+
type_info: TyperEx.TypeDefinitionItemType,
|
|
71
|
+
) -> str:
|
|
72
|
+
"""Convert type information from command line arguments to a string representation.
|
|
73
|
+
|
|
74
|
+
Args:
|
|
75
|
+
arg_name (str): The name of the command line argument.
|
|
76
|
+
type_info (TyperEx.TypeDefinitionItemType): Type information for the accepted value.
|
|
77
|
+
|
|
78
|
+
Returns:
|
|
79
|
+
str: String description of the command line argument.
|
|
80
|
+
|
|
81
|
+
"""
|
|
82
|
+
if isinstance(type_info, TyperEx.TypeDefinitionItem):
|
|
83
|
+
python_type = type_info.python_type
|
|
84
|
+
parameter_info = type_info.parameter_info
|
|
85
|
+
elif isinstance(type_info, tuple):
|
|
86
|
+
python_type = type_info[0]
|
|
87
|
+
parameter_info = type_info[1]
|
|
88
|
+
else:
|
|
89
|
+
python_type = type_info
|
|
90
|
+
parameter_info = None
|
|
91
|
+
|
|
92
|
+
return " {arg_name:<50} {type_description:<7} {help}".format(
|
|
93
|
+
arg_name=arg_name,
|
|
94
|
+
type_description=python_type.__name__,
|
|
95
|
+
help="" if parameter_info is None else parameter_info.help,
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
|
|
67
99
|
# ----------------------------------------------------------------------
|
|
68
100
|
def _HelpEpilog() -> str:
|
|
69
101
|
content: list[str] = []
|
|
70
102
|
|
|
71
|
-
# ----------------------------------------------------------------------
|
|
72
|
-
def TypeInfoToString(
|
|
73
|
-
arg_name: str,
|
|
74
|
-
type_info: TyperEx.TypeDefinitionItemType,
|
|
75
|
-
) -> str:
|
|
76
|
-
if isinstance(type_info, TyperEx.TypeDefinitionItem):
|
|
77
|
-
python_type = type_info.python_type
|
|
78
|
-
parameter_info = type_info.parameter_info
|
|
79
|
-
elif isinstance(type_info, tuple):
|
|
80
|
-
python_type = type_info[0]
|
|
81
|
-
parameter_info = type_info[1]
|
|
82
|
-
else:
|
|
83
|
-
python_type = type_info
|
|
84
|
-
parameter_info = None
|
|
85
|
-
|
|
86
|
-
return " {arg_name:<50} {type_description:<7} {help}".format(
|
|
87
|
-
arg_name=arg_name,
|
|
88
|
-
type_description=python_type.__name__,
|
|
89
|
-
help="" if parameter_info is None else parameter_info.help,
|
|
90
|
-
)
|
|
91
|
-
|
|
92
103
|
# ----------------------------------------------------------------------
|
|
93
104
|
|
|
94
105
|
for module in _all_modules:
|
|
@@ -181,7 +192,7 @@ def _VersionCallback(value: bool) -> None: # noqa: FBT001
|
|
|
181
192
|
epilog=_HelpEpilog(),
|
|
182
193
|
no_args_is_help=False,
|
|
183
194
|
)
|
|
184
|
-
def EntryPoint( # noqa: PLR0913
|
|
195
|
+
def EntryPoint( # noqa: PLR0913 # pragma: no cover
|
|
185
196
|
ctx: typer.Context,
|
|
186
197
|
version: Annotated[ # noqa: ARG001, FBT002
|
|
187
198
|
bool,
|
|
@@ -73,11 +73,10 @@ class Description(Requirement):
|
|
|
73
73
|
) -> Requirement.EvaluateImplResult:
|
|
74
74
|
standard_data = query_data["standard"]
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
result = standard_data.get("description", None)
|
|
77
|
+
if result is None:
|
|
77
78
|
return CreateIncompleteDataResult()
|
|
78
79
|
|
|
79
|
-
result = standard_data["description"]
|
|
80
|
-
|
|
81
80
|
expect_description = not requirement_args["allow-empty"]
|
|
82
81
|
|
|
83
82
|
if expect_description and not result:
|
|
@@ -7,12 +7,14 @@
|
|
|
7
7
|
"""Unit tests for EntryPoint.py"""
|
|
8
8
|
|
|
9
9
|
import pytest
|
|
10
|
+
import typer
|
|
10
11
|
|
|
11
12
|
from dbrownell_Common.TestHelpers.StreamTestHelpers import InitializeStreamCapabilities
|
|
13
|
+
from dbrownell_Common.TyperEx import TypeDefinitionItem # type: ignore [import-untyped]
|
|
12
14
|
from typer.testing import CliRunner
|
|
13
15
|
|
|
14
16
|
from RepoAuditor import __version__
|
|
15
|
-
from RepoAuditor.EntryPoint import app
|
|
17
|
+
from RepoAuditor.EntryPoint import app, TypeInfoToString
|
|
16
18
|
|
|
17
19
|
from Plugins.utilities import GetGithubUrl
|
|
18
20
|
|
|
@@ -58,3 +60,39 @@ def test_Help() -> None:
|
|
|
58
60
|
|
|
59
61
|
assert result.exit_code == 0
|
|
60
62
|
assert "Module Information" in result.output
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def test_TypeInfoToString() -> None:
|
|
66
|
+
"""Test the TypeInfoToString function to ensure valid command line output."""
|
|
67
|
+
result = TypeInfoToString(
|
|
68
|
+
"test_arg",
|
|
69
|
+
(
|
|
70
|
+
bool,
|
|
71
|
+
typer.Option(
|
|
72
|
+
False,
|
|
73
|
+
help="Help text.",
|
|
74
|
+
),
|
|
75
|
+
),
|
|
76
|
+
)
|
|
77
|
+
expected_string = " test_arg bool Help text."
|
|
78
|
+
assert expected_string == result
|
|
79
|
+
|
|
80
|
+
result = TypeInfoToString(
|
|
81
|
+
"test_arg",
|
|
82
|
+
TypeDefinitionItem(
|
|
83
|
+
bool,
|
|
84
|
+
typer.models.ParameterInfo(
|
|
85
|
+
default=False,
|
|
86
|
+
help="TypeDefinitionItem",
|
|
87
|
+
),
|
|
88
|
+
),
|
|
89
|
+
)
|
|
90
|
+
expected_string = " test_arg bool TypeDefinitionItem"
|
|
91
|
+
assert expected_string == result
|
|
92
|
+
|
|
93
|
+
result = TypeInfoToString(
|
|
94
|
+
"test_none",
|
|
95
|
+
bool,
|
|
96
|
+
)
|
|
97
|
+
expected_string = " test_none bool "
|
|
98
|
+
assert expected_string == result
|