RepoAuditor 0.2.60__tar.gz → 0.2.66__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.
Files changed (170) hide show
  1. {repoauditor-0.2.60 → repoauditor-0.2.66}/PKG-INFO +15 -12
  2. {repoauditor-0.2.60 → repoauditor-0.2.66}/README.md +14 -11
  3. repoauditor-0.2.66/default_config.yaml +4 -0
  4. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Display.py +20 -9
  5. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/Impl/EnableRulesetRequirementImpl.py +53 -15
  6. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/Impl/ValueRequirementImpl.py +8 -11
  7. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/RulesetQuery.py +3 -0
  8. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequirePullRequests.py +3 -3
  9. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireSignedCommits.py +3 -3
  10. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/RequireStatusChecks.py +2 -2
  11. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/Description.py +2 -4
  12. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/License.py +15 -11
  13. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/MergeCommitMessage.py +5 -5
  14. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SquashMergeCommitMessage.py +5 -5
  15. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/__init__.py +1 -1
  16. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/ClassicValueRequirementImpl_UnitTest.py +2 -2
  17. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/EnableRulesetRequirementImpl_UnitTest.py +45 -13
  18. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/RulesetRequirements_UnitTest.py +16 -16
  19. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/StandardQueryRequirements/Description_UnitTest.py +16 -10
  20. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/StandardQueryRequirements/License_UnitTest.py +1 -1
  21. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHub_EndToEndTest.py +68 -8
  22. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/__snapshots__/CommunityStandards_EndToEndTest.ambr +168 -48
  23. repoauditor-0.2.60/tests/Plugins/__snapshots__/GitHub_EndToEndTest.ambr → repoauditor-0.2.66/tests/Plugins/__snapshots__/GitHubEnterprise_EndToEndTest.ambr +455 -375
  24. repoauditor-0.2.66/tests/Plugins/__snapshots__/GitHub_EndToEndTest.ambr +2271 -0
  25. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/__snapshots__/ExecuteModules_UnitTest.ambr +896 -256
  26. repoauditor-0.2.60/default_config.yaml +0 -4
  27. repoauditor-0.2.60/tests/Plugins/__snapshots__/GitHubEnterprise_EndToEndTest.ambr +0 -1366
  28. {repoauditor-0.2.60 → repoauditor-0.2.66}/.copier-answers.yml +0 -0
  29. {repoauditor-0.2.60 → repoauditor-0.2.66}/.github/CODEOWNERS +0 -0
  30. {repoauditor-0.2.60 → repoauditor-0.2.66}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  31. {repoauditor-0.2.60 → repoauditor-0.2.66}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  32. {repoauditor-0.2.60 → repoauditor-0.2.66}/.github/ISSUE_TEMPLATE/custom.md +0 -0
  33. {repoauditor-0.2.60 → repoauditor-0.2.66}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  34. {repoauditor-0.2.60 → repoauditor-0.2.66}/.github/actions/release_impl/action.yml +0 -0
  35. {repoauditor-0.2.60 → repoauditor-0.2.66}/.github/pull_request_template.md +0 -0
  36. {repoauditor-0.2.60 → repoauditor-0.2.66}/.github/release_sources.yaml +0 -0
  37. {repoauditor-0.2.60 → repoauditor-0.2.66}/.github/workflows/CICD.yml +0 -0
  38. {repoauditor-0.2.60 → repoauditor-0.2.66}/.github/workflows/CICD_impl.yml +0 -0
  39. {repoauditor-0.2.60 → repoauditor-0.2.66}/.github/workflows/EndToEnd.yml +0 -0
  40. {repoauditor-0.2.60 → repoauditor-0.2.66}/.github/workflows/codeql.yml +0 -0
  41. {repoauditor-0.2.60 → repoauditor-0.2.66}/.gitignore +0 -0
  42. {repoauditor-0.2.60 → repoauditor-0.2.66}/.pre-commit-config.yaml +0 -0
  43. {repoauditor-0.2.60 → repoauditor-0.2.66}/.python-version +0 -0
  44. {repoauditor-0.2.60 → repoauditor-0.2.66}/CODE_OF_CONDUCT.md +0 -0
  45. {repoauditor-0.2.60 → repoauditor-0.2.66}/CONTRIBUTING.md +0 -0
  46. {repoauditor-0.2.60 → repoauditor-0.2.66}/DEVELOPMENT.md +0 -0
  47. {repoauditor-0.2.60 → repoauditor-0.2.66}/GOVERNANCE.md +0 -0
  48. {repoauditor-0.2.60 → repoauditor-0.2.66}/LICENSE +0 -0
  49. {repoauditor-0.2.60 → repoauditor-0.2.66}/MAINTAINERS.md +0 -0
  50. {repoauditor-0.2.60 → repoauditor-0.2.66}/SECURITY.md +0 -0
  51. {repoauditor-0.2.60 → repoauditor-0.2.66}/minisign_key.pub +0 -0
  52. {repoauditor-0.2.60 → repoauditor-0.2.66}/pyproject.toml +0 -0
  53. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/AutoGitSemVer.yaml +0 -0
  54. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/CommandLineProcessor.py +0 -0
  55. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/EntryPoint.py +0 -0
  56. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/ExecuteModules.py +0 -0
  57. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Impl/ParallelSequentialProcessor.py +0 -0
  58. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Impl/__init__.py +0 -0
  59. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Module.py +0 -0
  60. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugin.py +0 -0
  61. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/CommunityStandards/CommunityStandardsQuery.py +0 -0
  62. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/CommunityStandards/Impl/ExistsRequirementImpl.py +0 -0
  63. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/CommunityStandards/Impl/__init__.py +0 -0
  64. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/CommunityStandards/Module.py +0 -0
  65. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/CodeOfConduct.py +0 -0
  66. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/CodeOwners.py +0 -0
  67. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/Contributing.py +0 -0
  68. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/IssueTemplates.py +0 -0
  69. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/LicenseFile.py +0 -0
  70. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/PullRequestTemplates.py +0 -0
  71. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/ReadMe.py +0 -0
  72. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/SecurityPolicy.py +0 -0
  73. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/CommunityStandards/Requirements/__init__.py +0 -0
  74. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/CommunityStandards/__init__.py +0 -0
  75. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/CommunityStandardsPlugin.py +0 -0
  76. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionQuery.py +0 -0
  77. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/AllowDeletions.py +0 -0
  78. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/AllowMainlineForcePushes.py +0 -0
  79. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/DismissStalePullRequestApprovals.py +0 -0
  80. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/DoNotAllowBypassSettings.py +0 -0
  81. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/EnsureStatusChecks.py +0 -0
  82. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/ClassicEnableRequirementImpl.py +0 -0
  83. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/ClassicValueRequirementImpl.py +0 -0
  84. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/__init__.py +0 -0
  85. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireApprovalMostRecentPush.py +0 -0
  86. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireApprovals.py +0 -0
  87. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireCodeOwnerReview.py +0 -0
  88. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireConversationResolution.py +0 -0
  89. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireLinearHistory.py +0 -0
  90. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequirePullRequests.py +0 -0
  91. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireSignedCommits.py +0 -0
  92. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireStatusChecksToPass.py +0 -0
  93. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireUpToDateBranches.py +0 -0
  94. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/__init__.py +0 -0
  95. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/DefaultBranchQuery.py +0 -0
  96. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/DefaultBranchRequirements/Protected.py +0 -0
  97. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/DefaultBranchRequirements/__init__.py +0 -0
  98. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/Impl/Common.py +0 -0
  99. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/Impl/EnableRequirementImpl.py +0 -0
  100. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/Impl/__init__.py +0 -0
  101. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/Module.py +0 -0
  102. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/RulesetRequirements/__init__.py +0 -0
  103. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardQuery.py +0 -0
  104. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/AutoMerge.py +0 -0
  105. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/DefaultBranch.py +0 -0
  106. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/DeleteHeadBranches.py +0 -0
  107. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/DependabotSecurityUpdates.py +0 -0
  108. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/Impl/StandardEnableRequirementImpl.py +0 -0
  109. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/Impl/StandardValueRequirementImpl.py +0 -0
  110. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/Impl/__init__.py +0 -0
  111. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/MergeCommit.py +0 -0
  112. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/Private.py +0 -0
  113. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/RebaseMergeCommit.py +0 -0
  114. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SecretScanning.py +0 -0
  115. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SecretScanningPushProtection.py +0 -0
  116. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SquashCommitMerge.py +0 -0
  117. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SuggestUpdatingPullRequestBranches.py +0 -0
  118. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SupportDiscussions.py +0 -0
  119. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SupportIssues.py +0 -0
  120. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SupportProjects.py +0 -0
  121. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/SupportWikis.py +0 -0
  122. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/TemplateRepository.py +0 -0
  123. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/WebCommitSignoff.py +0 -0
  124. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/StandardRequirements/__init__.py +0 -0
  125. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHub/__init__.py +0 -0
  126. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHubBase/Module.py +0 -0
  127. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHubBase/__init__.py +0 -0
  128. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/GitHubPlugin.py +0 -0
  129. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Plugins/__init__.py +0 -0
  130. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Query.py +0 -0
  131. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/Requirement.py +0 -0
  132. {repoauditor-0.2.60 → repoauditor-0.2.66}/src/RepoAuditor/py.typed +0 -0
  133. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/CommandLineProcessor_UnitTest.py +0 -0
  134. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/EntryPoint_UnitTest.py +0 -0
  135. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/ExecuteModules_UnitTest.py +0 -0
  136. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Module_UnitTest.py +0 -0
  137. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugin_UnitTest.py +0 -0
  138. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/CommunityStandards/CommunityStandardsQuery_UnitTest.py +0 -0
  139. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/CommunityStandards/ExistsRequirementImpl_UnitTest.py +0 -0
  140. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/CommunityStandards/GitHubCommunityStandards_UnitTest.py +0 -0
  141. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/CommunityStandards_EndToEndTest.py +0 -0
  142. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubEnterprise_EndToEndTest.py +0 -0
  143. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/ClassicBranchProtectionQuery_UnitTest.py +0 -0
  144. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/DismissStalePullRequestApprovals_UnitTest.py +0 -0
  145. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/EnsureStatusChecks_UnitTest.py +0 -0
  146. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/RequireApprovalMostRecentPush_UnitTest.py +0 -0
  147. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/RequireApprovals_UnitTest.py +0 -0
  148. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/RequireCodeOwnerReview_UnitTest.py +0 -0
  149. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/RequireUpToDateBranches_UnitTest.py +0 -0
  150. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/DefaultBranchQueryRequirements/Protected_UnitTest.py +0 -0
  151. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/DefaultBranchQuery_UnitTest.py +0 -0
  152. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/GitHubModule_UnitTest.py +0 -0
  153. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/GitHubSession_UnitTest.py +0 -0
  154. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/RulsesetQuery_UnitTest.py +0 -0
  155. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/StandardQueryRequirements/DependabotSecurityUpdates_UnitTest.py +0 -0
  156. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/StandardQueryRequirements/MergeCommitMessage_UnitTest.py +0 -0
  157. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/StandardQueryRequirements/Private_UnitTest.py +0 -0
  158. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/StandardQueryRequirements/SecretScanningPushProtection_UnitTest.py +0 -0
  159. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/StandardQueryRequirements/SecretScanning_UnitTest.py +0 -0
  160. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/StandardQueryRequirements/SquashMergeCommitMessage_UnitTest.py +0 -0
  161. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/StandardQuery_UnitTest.py +0 -0
  162. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/ValueRequrementImpl_UnitTest.py +0 -0
  163. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/GitHubModule/fixtures.py +0 -0
  164. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/conftest.py +0 -0
  165. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Plugins/utilities.py +0 -0
  166. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Query_UnitTest.py +0 -0
  167. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/Requirement_UnitTest.py +0 -0
  168. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/__init__.py +0 -0
  169. {repoauditor-0.2.60 → repoauditor-0.2.66}/tests/conftest.py +0 -0
  170. {repoauditor-0.2.60 → repoauditor-0.2.66}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: RepoAuditor
3
- Version: 0.2.60
3
+ Version: 0.2.66
4
4
  Summary: Add your description here
5
5
  Project-URL: Homepage, https://github.com/gt-sse-center/RepoAuditor
6
6
  Project-URL: Documentation, https://github.com/gt-sse-center/RepoAuditor
@@ -42,19 +42,29 @@ Description-Content-Type: text/markdown
42
42
  <!-- Content above this delimiter will be copied to the generated README.md file. DO NOT REMOVE THIS COMMENT, as it will cause regeneration to fail. -->
43
43
 
44
44
  ## Contents
45
+ - [Installation](#installation)
45
46
  - [Overview](#overview)
46
47
  - [How to use RepoAuditor](#how-to-use-repoauditor)
47
48
  - [Personal Access Token](#personal-access-token)
48
49
  - [Example Usage](#example-usage)
49
- - [Installation](#installation)
50
50
  - [Development](#development)
51
+ - [Verifying Signed Artifacts](#verifying-signed-artifacts)
51
52
  - [Additional Information](#additional-information)
52
53
  - [License](#license)
53
54
 
54
- ## Overview
55
+ ## Installation
56
+
57
+ You can install `RepoAuditor` via `uv` or `pip`.
55
58
 
56
59
  We recommend using [uv](https://docs.astral.sh/uv/#uv) since `RepoAuditor` uses `uv` to create and manage a virtual environment.
57
60
 
61
+ | Installation Method | Command |
62
+ | --- | --- |
63
+ | Via [uv](https://github.com/astral-sh/uv) | `uv add repoauditor` |
64
+ | Via [pip](https://pip.pypa.io/en/stable/) | `pip install repoauditor` |
65
+
66
+ ## Overview
67
+
58
68
  ### How to use RepoAuditor
59
69
 
60
70
  <!-- Content below this delimiter will be copied to the generated README.md file. DO NOT REMOVE THIS COMMENT, as it will cause regeneration to fail. -->
@@ -113,12 +123,8 @@ uv run repo_auditor --include GitHub --GitHub-url https://github.com/<username>/
113
123
 
114
124
  `RepoAuditor` will generate a series of messages describing all the issues in the repository, along with the rationale behind them and the steps for resolution.
115
125
 
116
- ## Installation
117
-
118
- | Installation Method | Command |
119
- | --- | --- |
120
- | Via [uv](https://github.com/astral-sh/uv) | `uv add repoauditor` |
121
- | Via [pip](https://pip.pypa.io/en/stable/) | `pip install repoauditor` |
126
+ ## Development
127
+ Please visit [Contributing](https://github.com/gt-sse-center/RepoAuditor/blob/main/CONTRIBUTING.md) and [Development](https://github.com/gt-sse-center/RepoAuditor/blob/main/DEVELOPMENT.md) for information on contributing to this project.
122
128
 
123
129
  ### Verifying Signed Artifacts
124
130
  Artifacts are signed and validated using [py-minisign](https://github.com/x13a/py-minisign) and the public key in the file `./minisign_key.pub`.
@@ -129,9 +135,6 @@ To verify that an artifact is valid, visit [the latest release](https://github.c
129
135
  uv run --with py-minisign python -c "import minisign; minisign.PublicKey.from_file('minisign_key.pub').verify_file('<filename>')"
130
136
  ```
131
137
 
132
- ## Development
133
- Please visit [Contributing](https://github.com/gt-sse-center/RepoAuditor/blob/main/CONTRIBUTING.md) and [Development](https://github.com/gt-sse-center/RepoAuditor/blob/main/DEVELOPMENT.md) for information on contributing to this project.
134
-
135
138
  ## Additional Information
136
139
  Additional information can be found at these locations.
137
140
 
@@ -15,19 +15,29 @@
15
15
  <!-- Content above this delimiter will be copied to the generated README.md file. DO NOT REMOVE THIS COMMENT, as it will cause regeneration to fail. -->
16
16
 
17
17
  ## Contents
18
+ - [Installation](#installation)
18
19
  - [Overview](#overview)
19
20
  - [How to use RepoAuditor](#how-to-use-repoauditor)
20
21
  - [Personal Access Token](#personal-access-token)
21
22
  - [Example Usage](#example-usage)
22
- - [Installation](#installation)
23
23
  - [Development](#development)
24
+ - [Verifying Signed Artifacts](#verifying-signed-artifacts)
24
25
  - [Additional Information](#additional-information)
25
26
  - [License](#license)
26
27
 
27
- ## Overview
28
+ ## Installation
29
+
30
+ You can install `RepoAuditor` via `uv` or `pip`.
28
31
 
29
32
  We recommend using [uv](https://docs.astral.sh/uv/#uv) since `RepoAuditor` uses `uv` to create and manage a virtual environment.
30
33
 
34
+ | Installation Method | Command |
35
+ | --- | --- |
36
+ | Via [uv](https://github.com/astral-sh/uv) | `uv add repoauditor` |
37
+ | Via [pip](https://pip.pypa.io/en/stable/) | `pip install repoauditor` |
38
+
39
+ ## Overview
40
+
31
41
  ### How to use RepoAuditor
32
42
 
33
43
  <!-- Content below this delimiter will be copied to the generated README.md file. DO NOT REMOVE THIS COMMENT, as it will cause regeneration to fail. -->
@@ -86,12 +96,8 @@ uv run repo_auditor --include GitHub --GitHub-url https://github.com/<username>/
86
96
 
87
97
  `RepoAuditor` will generate a series of messages describing all the issues in the repository, along with the rationale behind them and the steps for resolution.
88
98
 
89
- ## Installation
90
-
91
- | Installation Method | Command |
92
- | --- | --- |
93
- | Via [uv](https://github.com/astral-sh/uv) | `uv add repoauditor` |
94
- | Via [pip](https://pip.pypa.io/en/stable/) | `pip install repoauditor` |
99
+ ## Development
100
+ Please visit [Contributing](https://github.com/gt-sse-center/RepoAuditor/blob/main/CONTRIBUTING.md) and [Development](https://github.com/gt-sse-center/RepoAuditor/blob/main/DEVELOPMENT.md) for information on contributing to this project.
95
101
 
96
102
  ### Verifying Signed Artifacts
97
103
  Artifacts are signed and validated using [py-minisign](https://github.com/x13a/py-minisign) and the public key in the file `./minisign_key.pub`.
@@ -102,9 +108,6 @@ To verify that an artifact is valid, visit [the latest release](https://github.c
102
108
  uv run --with py-minisign python -c "import minisign; minisign.PublicKey.from_file('minisign_key.pub').verify_file('<filename>')"
103
109
  ```
104
110
 
105
- ## Development
106
- Please visit [Contributing](https://github.com/gt-sse-center/RepoAuditor/blob/main/CONTRIBUTING.md) and [Development](https://github.com/gt-sse-center/RepoAuditor/blob/main/DEVELOPMENT.md) for information on contributing to this project.
107
-
108
111
  ## Additional Information
109
112
  Additional information can be found at these locations.
110
113
 
@@ -0,0 +1,4 @@
1
+ includes: ["GitHub", "CommunityStandards"]
2
+ GitHub-url: "https://github.com/gt-sse-center/RepoAuditor"
3
+ CommunityStandards-url: "https://github.com/gt-sse-center/RepoAuditor"
4
+ # GitHub-pat: "PAT"
@@ -37,16 +37,16 @@ def GetInternalPanelContent(
37
37
  if module.description:
38
38
  internal_content.append(f"{module.description.strip()}\n")
39
39
 
40
- internal_content.append(
41
- textwrap.dedent(
42
- f"""\
43
- Successful: {num_success} ({(num_success / num_requirements):.02%})
44
- Warnings: {num_warning} ({(num_warning / num_requirements):.02%})
45
- Errors: {num_error} ({(num_error / num_requirements):.02%})
46
- Skipped: {num_does_not_apply} ({(num_does_not_apply / num_requirements):.02%})
47
- """,
48
- ),
40
+ metrics_display = textwrap.dedent(
41
+ f"""\
42
+ [grey66]
43
+ Successful: {num_success} ({(num_success / num_requirements):.02%})
44
+ Warnings: {num_warning} ({(num_warning / num_requirements):.02%})
45
+ Errors: {num_error} ({(num_error / num_requirements):.02%})
46
+ Skipped: {num_does_not_apply} ({(num_does_not_apply / num_requirements):.02%})
47
+ """,
49
48
  )
49
+ internal_content.append(metrics_display)
50
50
 
51
51
  for result in results:
52
52
  if not dm.is_verbose and result.result in [
@@ -106,6 +106,17 @@ def GetInternalPanelContent(
106
106
  ),
107
107
  )
108
108
 
109
+ # Finally print statistics at the end in a panel if verbose
110
+ internal_content.append(
111
+ Panel(
112
+ metrics_display,
113
+ title="Metrics",
114
+ title_align="left",
115
+ border_style="grey66",
116
+ padding=(1, 1, 0, 1),
117
+ ),
118
+ )
119
+
109
120
  return internal_content
110
121
 
111
122
 
@@ -59,25 +59,63 @@ class EnableRulesetRequirementImpl(EnableRequirementImpl):
59
59
  query_data: dict[str, Any],
60
60
  requirement_args: dict[str, Any],
61
61
  ) -> Requirement.EvaluateImplResult:
62
+ expected_rule_enabled = self.enabled_by_default
63
+
62
64
  if requirement_args[self.dynamic_arg_name]:
63
- # Get the rules for the specified branch
64
- rules = query_data.get("rules", [])
65
-
66
- for rule in rules:
67
- if self.get_configuration_value_func(rule):
68
- # Get the ruleset associated with the rule
69
- ruleset = rule["ruleset"]
70
- return self.EvaluateImplResult(
71
- EvaluateResult.Success,
72
- f"Ruleset '{ruleset['name']}' enforces {self.github_settings_value}",
73
- )
65
+ expected_rule_enabled = not expected_rule_enabled
66
+ provide_rationale = False
67
+ else:
68
+ provide_rationale = True
69
+
70
+ query_data["__expected_value"] = "Enable" if expected_rule_enabled else "Disable"
71
+
72
+ # Get the rules for the specified branch
73
+ rules = query_data.get("rules", [])
74
+
75
+ # Check if the rule is checked in the ruleset
76
+ rule_enabled = False
77
+ ruleset = None
78
+ for rule in rules:
79
+ # If the rule is present, it is checked
80
+ if self.get_configuration_value_func(rule):
81
+ rule_enabled = True
82
+ # Get the ruleset associated with the rule
83
+ ruleset = rule["ruleset"]
84
+ break
85
+
86
+ # If rule is active and we want it enabled,
87
+ # or rule is inactive and we want it disabled,
88
+ # return success.
89
+ if rule_enabled == expected_rule_enabled:
90
+ context = (
91
+ f"{self.github_settings_value} is enabled in Ruleset '{ruleset['name']}'"
92
+ if expected_rule_enabled
93
+ else f"{self.github_settings_value} is disabled"
94
+ )
95
+ return self.EvaluateImplResult(
96
+ EvaluateResult.Success,
97
+ context,
98
+ )
99
+
100
+ # When rule is active but we want it disabled
101
+ if rule_enabled:
102
+ assert expected_rule_enabled is False
74
103
 
75
104
  return self.EvaluateImplResult(
76
105
  EvaluateResult.Error,
77
- f"No active branch ruleset requiring {self.github_settings_value} found",
106
+ f"{self.github_settings_value} rule active in ruleset '{ruleset['name']}'."
107
+ f"It should be set to {expected_rule_enabled}",
78
108
  provide_resolution=True,
79
- provide_rationale=True,
109
+ provide_rationale=provide_rationale,
80
110
  )
81
111
 
82
- # Requirement flag not set so DoesNotApply
83
- return Requirement.EvaluateImplResult(EvaluateResult.DoesNotApply, None)
112
+ # Rule is inactive but we want it on
113
+ assert rule_enabled is False
114
+ assert expected_rule_enabled is True
115
+
116
+ return self.EvaluateImplResult(
117
+ EvaluateResult.Error,
118
+ f"No active branch ruleset requiring {self.github_settings_value} found",
119
+ provide_resolution=True,
120
+ provide_rationale=provide_rationale,
121
+ )
@@ -28,14 +28,14 @@ class DoesNotApplyResult:
28
28
 
29
29
  # ----------------------------------------------------------------------
30
30
  class ValueRequirementImpl(Requirement):
31
- """Object that implements settings specified by a value."""
31
+ """Object that implements checking of metadata/settings are set to the specified value."""
32
32
 
33
33
  # ----------------------------------------------------------------------
34
34
  def __init__(
35
35
  self,
36
36
  name: str,
37
37
  default_value: str,
38
- github_settings_value: Optional[str],
38
+ github_value: Optional[str],
39
39
  get_configuration_value_func: Callable[[dict[str, Any]], str | DoesNotApplyResult | None],
40
40
  resolution: str,
41
41
  rationale: str,
@@ -44,13 +44,10 @@ class ValueRequirementImpl(Requirement):
44
44
  requires_explicit_include: bool = False,
45
45
  missing_value_is_warning: bool = True,
46
46
  ) -> None:
47
- if github_settings_value is None:
48
- github_settings_value = "the entity"
49
- else:
50
- github_settings_value = f"'{github_settings_value}'"
47
+ github_value = f"'{github_value}'" if github_value else "the entity"
51
48
 
52
49
  if subject is None:
53
- subject = github_settings_value
50
+ subject = github_value
54
51
 
55
52
  super().__init__(
56
53
  name,
@@ -61,7 +58,7 @@ class ValueRequirementImpl(Requirement):
61
58
  requires_explicit_include=requires_explicit_include,
62
59
  )
63
60
 
64
- self.github_settings_value = github_settings_value
61
+ self.github_value = github_value
65
62
  self.default_value = default_value
66
63
  self.get_configuration_value_func = get_configuration_value_func
67
64
  self.missing_value_is_warning = missing_value_is_warning
@@ -75,7 +72,7 @@ class ValueRequirementImpl(Requirement):
75
72
  str,
76
73
  typer.Option(
77
74
  self.default_value,
78
- help=f"Ensures that {self.github_settings_value} is set to the provided value.",
75
+ help=f"Ensures that {self.github_value} is set to the provided value.",
79
76
  ),
80
77
  ),
81
78
  }
@@ -103,7 +100,7 @@ class ValueRequirementImpl(Requirement):
103
100
 
104
101
  return Requirement.EvaluateImplResult(
105
102
  EvaluateResult.Error,
106
- f"{self.github_settings_value} cannot be set to '{expected_value}' because {result.reason}",
103
+ f"{self.github_value} cannot be set to '{expected_value}' because {result.reason}",
107
104
  )
108
105
 
109
106
  result = str(result)
@@ -113,7 +110,7 @@ class ValueRequirementImpl(Requirement):
113
110
 
114
111
  return Requirement.EvaluateImplResult(
115
112
  EvaluateResult.Error,
116
- f"{self.github_settings_value} must be set to '{expected_value}' (it is currently set to '{result}').",
113
+ f"{self.github_value} must be set to '{expected_value}' (it is currently set to '{result}').",
117
114
  provide_resolution=True,
118
115
  provide_rationale=is_default_expected_value,
119
116
  )
@@ -56,6 +56,9 @@ class RulesetQuery(Query):
56
56
 
57
57
  branch = response["default_branch"]
58
58
 
59
+ # Record the branch name
60
+ module_data["branch"] = branch
61
+
59
62
  # Fetch ruleset data for a specific branch.
60
63
  # This only returns active rules on the branch
61
64
  rules_response = module_data["session"].get(f"rules/branches/{branch}")
@@ -15,11 +15,11 @@ class RequirePullRequests(EnableRulesetRequirementImpl):
15
15
  def __init__(self) -> None:
16
16
  super().__init__(
17
17
  name="RequirePullRequests",
18
- enabled_by_default=False,
19
- dynamic_arg_name="enabled",
18
+ enabled_by_default=True,
19
+ dynamic_arg_name="disabled",
20
20
  github_ruleset_type="pull_request",
21
21
  github_ruleset_value="Pull Requests",
22
22
  get_configuration_value_func=lambda rule: rule.get("type", "") == "pull_request",
23
- resolution="Enable pull request requirements in repository rulesets",
23
+ resolution="{__expected_value} pull request rule in repository rulesets",
24
24
  rationale="Pull request reviews help maintain code quality and collaboration",
25
25
  )
@@ -10,13 +10,13 @@ from RepoAuditor.Plugins.GitHub.Impl.EnableRulesetRequirementImpl import EnableR
10
10
 
11
11
 
12
12
  class RequireSignedCommits(EnableRulesetRequirementImpl):
13
- """Require signed commits."""
13
+ """Check that the "Require signed commits" rule is disabled."""
14
14
 
15
15
  def __init__(self) -> None:
16
16
  super().__init__(
17
17
  name="RequireSignedCommits",
18
- enabled_by_default=False,
19
- dynamic_arg_name="enabled",
18
+ enabled_by_default=True,
19
+ dynamic_arg_name="disabled",
20
20
  github_ruleset_type="required_signatures",
21
21
  github_ruleset_value="Signed Commits",
22
22
  get_configuration_value_func=lambda rule: rule.get("type", "") == "required_signatures",
@@ -15,8 +15,8 @@ class RequireStatusChecks(EnableRulesetRequirementImpl):
15
15
  def __init__(self) -> None:
16
16
  super().__init__(
17
17
  name="RequireStatusChecks",
18
- enabled_by_default=False,
19
- dynamic_arg_name="enabled",
18
+ enabled_by_default=True,
19
+ dynamic_arg_name="disabled",
20
20
  github_ruleset_type="required_status_checks",
21
21
  github_ruleset_value="Status Checks",
22
22
  get_configuration_value_func=lambda rule: rule.get("type", "") == "required_status_checks",
@@ -13,7 +13,6 @@ import typer
13
13
  from dbrownell_Common.TyperEx import TypeDefinitionItemType # type: ignore[import-untyped]
14
14
  from dbrownell_Common.Types import override # type: ignore[import-untyped]
15
15
 
16
- from RepoAuditor.Plugins.GitHub.Impl.Common import CreateIncompleteDataResult
17
16
  from RepoAuditor.Requirement import EvaluateResult, ExecutionStyle, Requirement
18
17
 
19
18
 
@@ -73,10 +72,9 @@ class Description(Requirement):
73
72
  ) -> Requirement.EvaluateImplResult:
74
73
  standard_data = query_data["standard"]
75
74
 
75
+ # If result is None, it means the description is empty.
76
+ # It is not a permissions issue, since "Read Metadata" is a mandatory permission for all PATs
76
77
  result = standard_data.get("description", None)
77
- if result is None:
78
- return CreateIncompleteDataResult()
79
-
80
78
  expect_description = not requirement_args["allow-empty"]
81
79
 
82
80
  if expect_description and not result:
@@ -9,25 +9,29 @@
9
9
  import textwrap
10
10
  from typing import Any, Optional
11
11
 
12
- from RepoAuditor.Plugins.GitHub.StandardRequirements.Impl.StandardValueRequirementImpl import (
13
- StandardValueRequirementImpl,
14
- )
12
+ from RepoAuditor.Plugins.GitHub.Impl.ValueRequirementImpl import ValueRequirementImpl
15
13
 
16
14
 
17
15
  # ----------------------------------------------------------------------
18
- class License(StandardValueRequirementImpl):
16
+ class License(ValueRequirementImpl):
19
17
  """Default License as MIT Requirement."""
20
18
 
21
19
  # ----------------------------------------------------------------------
22
20
  def __init__(self) -> None:
23
21
  super().__init__(
24
- "License",
25
- "MIT License",
26
- "settings",
27
- None,
28
- None,
29
- _GetValue,
30
- textwrap.dedent(
22
+ name="License",
23
+ default_value="MIT License",
24
+ github_value="License",
25
+ get_configuration_value_func=_GetValue,
26
+ resolution=textwrap.dedent(
27
+ """\
28
+ 1) Create a LICENSE/LICENSE.md file in your main branch at the root of your repository.
29
+ 2) Add the appropriate licensing information in the above file.
30
+
31
+ For detailed information about open source licenses, you can visit: https://choosealicense.com/
32
+ """
33
+ ),
34
+ rationale=textwrap.dedent(
31
35
  """\
32
36
  The default behavior is to use the MIT License.
33
37
 
@@ -30,18 +30,18 @@ class MergeCommitMessage(StandardValueRequirementImpl):
30
30
  _GetValue,
31
31
  textwrap.dedent(
32
32
  """\
33
- Available values:
33
+ Available values on GitHub:
34
34
 
35
- PR_TITLE [Default message]
35
+ Default message [PR_TITLE]
36
36
  Pull Request number and head branch on the first line; pull request title on the third line
37
37
 
38
- BLANK [Default to pull request title]
38
+ Default to pull request title [BLANK]
39
39
  Pull Request title and number on the first line.
40
40
 
41
- PR_BODY [Default to pull request title and description]
41
+ Default to pull request title and description [PR_BODY]
42
42
  Pull Request title and number on the first line; pull request description starting on the third line.
43
43
 
44
- The default setting is BLANK.
44
+ The default setting is "Default to pull request title [BLANK]".
45
45
 
46
46
  Reasons for this Default
47
47
  ------------------------
@@ -30,20 +30,20 @@ class SquashMergeCommitMessage(StandardValueRequirementImpl):
30
30
  _GetValue,
31
31
  textwrap.dedent(
32
32
  """\
33
- Available values:
33
+ Available values on GitHub:
34
34
 
35
- BLANK [Default to pull request title]
35
+ Default to pull request title [BLANK]
36
36
  Pull Request title and number on the first line.
37
37
 
38
- COMMIT_MESSAGES [Default to pull request title and commit details]
38
+ Default to pull request title and commit details [COMMIT_MESSAGES]
39
39
  Commit title and...
40
40
  [Single Commit] ...commit message
41
41
  [Multiple Commits] ...pull request title and number and list of commits
42
42
 
43
- PR_BODY [Default to pull request title and description]
43
+ Default to pull request title and description [PR_BODY]
44
44
  Pull Request title and number on the first line; commit description starting on the third line.
45
45
 
46
- The default setting is COMMIT_MESSAGES.
46
+ The default setting is "Default to pull request title and commit details [COMMIT_MESSAGES]".
47
47
 
48
48
  Reasons for this Default
49
49
  ------------------------
@@ -2,4 +2,4 @@ APP_NAME = "RepoAuditor"
2
2
 
3
3
  # Note that the default value below will be used until the value
4
4
  # here is explicitly updated by the Continuous Integration system.
5
- __version__ = "0.2.60"
5
+ __version__ = "0.2.66"
@@ -22,7 +22,7 @@ class TestClassicValueRequirementImpl:
22
22
  get_configuration_value_func=lambda _: "yes",
23
23
  rationale="For testing",
24
24
  )
25
- assert requirement.github_settings_value == "'No Settings Section'"
25
+ assert requirement.github_value == "'No Settings Section'"
26
26
 
27
27
  def test_NoSettingsValue(self):
28
28
  """Test for when no github_settings_value is provided."""
@@ -34,4 +34,4 @@ class TestClassicValueRequirementImpl:
34
34
  get_configuration_value_func=lambda _: "yes",
35
35
  rationale="For testing",
36
36
  )
37
- assert requirement.github_settings_value == "the entity"
37
+ assert requirement.github_value == "the entity"
@@ -18,7 +18,7 @@ class TestEnableRulesetRequirementImpl:
18
18
  requirement = EnableRulesetRequirementImpl(
19
19
  name="Test Name",
20
20
  enabled_by_default=False,
21
- dynamic_arg_name="true",
21
+ dynamic_arg_name="enabled",
22
22
  github_ruleset_type="Test Ruleset",
23
23
  github_ruleset_value="test_ruleset",
24
24
  get_configuration_value_func=lambda _: True,
@@ -28,15 +28,15 @@ class TestEnableRulesetRequirementImpl:
28
28
 
29
29
  assert requirement.name == "Test Name"
30
30
  assert requirement.enabled_by_default is False
31
- assert requirement.dynamic_arg_name == "true"
31
+ assert requirement.dynamic_arg_name == "enabled"
32
32
  assert requirement.github_ruleset_type == "Test Ruleset"
33
33
 
34
- def test_Evaluate_DoesNotApply(self):
35
- """Test the _EvaluateImpl method when dynamic_arg_name is False."""
34
+ def test_Evaluate_Disabled(self):
35
+ """Test the _EvaluateImpl method when dynamic arg is set to `enabled: False`."""
36
36
  requirement = EnableRulesetRequirementImpl(
37
37
  name="Test Name",
38
38
  enabled_by_default=False,
39
- dynamic_arg_name="true",
39
+ dynamic_arg_name="enabled",
40
40
  github_ruleset_type="Test Ruleset",
41
41
  github_ruleset_value="test_ruleset",
42
42
  get_configuration_value_func=lambda _: True,
@@ -44,16 +44,48 @@ class TestEnableRulesetRequirementImpl:
44
44
  rationale="Test rationale",
45
45
  )
46
46
  query_data = {}
47
- requirement_args = {"true": False}
47
+ requirement_args = {"enabled": False}
48
48
  result = requirement.Evaluate(query_data, requirement_args)
49
- assert result.result == EvaluateResult.DoesNotApply
49
+ # No rule and should be disabled, hence result is success
50
+ assert result.result == EvaluateResult.Success
51
+
52
+ def test_Evaluate_Disabled_Alternative(self):
53
+ """Test the _EvaluateImpl method when dynamic arg is
54
+ set to `disabled: True` but rule is active.
55
+ """
56
+ requirement = EnableRulesetRequirementImpl(
57
+ name="True By Default",
58
+ enabled_by_default=True,
59
+ dynamic_arg_name="disabled",
60
+ github_ruleset_type="Test Ruleset",
61
+ github_ruleset_value="test_ruleset",
62
+ get_configuration_value_func=lambda rule: rule.get("type", "") == "valid_rule",
63
+ resolution="Test Resolution",
64
+ rationale="Test rationale",
65
+ )
66
+ query_data = {
67
+ "rules": [
68
+ {
69
+ "type": "valid_rule",
70
+ "ruleset": {
71
+ "name": "Valid",
72
+ "id": "01",
73
+ },
74
+ },
75
+ ]
76
+ }
77
+ requirement_args = {"disabled": True}
78
+ result = requirement.Evaluate(query_data, requirement_args)
79
+ # No rule and should be disabled, hence result is success
80
+ assert result.result == EvaluateResult.Error
81
+ assert "It should be set to False" in result.context
50
82
 
51
83
  def test_Evaluate_InvalidRule(self):
52
- """Test the _EvaluateImpl method when dynamic_arg_name is False."""
84
+ """Test the _EvaluateImpl method when dynamic arg is set to `enabled: True` and the rule found is invalid."""
53
85
  requirement = EnableRulesetRequirementImpl(
54
86
  name="Test Name",
55
87
  enabled_by_default=False,
56
- dynamic_arg_name="true",
88
+ dynamic_arg_name="enabled",
57
89
  github_ruleset_type="Test Ruleset",
58
90
  github_ruleset_value="test_ruleset",
59
91
  get_configuration_value_func=lambda rule: rule.get("type", "") == "valid rule",
@@ -71,16 +103,16 @@ class TestEnableRulesetRequirementImpl:
71
103
  },
72
104
  ]
73
105
  }
74
- requirement_args = {"true": True}
106
+ requirement_args = {"enabled": True}
75
107
  result = requirement.Evaluate(query_data, requirement_args)
76
108
  assert result.result == EvaluateResult.Error
77
109
 
78
110
  def test_Evaluate_ValidRule(self):
79
- """Test the _EvaluateImpl method when dynamic_arg_name is False."""
111
+ """Test the _EvaluateImpl method when dynamic arg is set to `enabled: True` and a valid rule is found."""
80
112
  requirement = EnableRulesetRequirementImpl(
81
113
  name="Test Name",
82
114
  enabled_by_default=False,
83
- dynamic_arg_name="true",
115
+ dynamic_arg_name="enabled",
84
116
  github_ruleset_type="Test Ruleset",
85
117
  github_ruleset_value="test_ruleset",
86
118
  get_configuration_value_func=lambda rule: rule.get("type", "") == "valid_rule",
@@ -98,7 +130,7 @@ class TestEnableRulesetRequirementImpl:
98
130
  }
99
131
  ]
100
132
  }
101
- requirement_args = {"true": True}
133
+ requirement_args = {"enabled": True}
102
134
  result = requirement.Evaluate(query_data, requirement_args)
103
135
 
104
136
  assert result.result == EvaluateResult.Success