RepoAuditor 0.2.7__tar.gz → 0.2.8__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 (107) hide show
  1. {repoauditor-0.2.7 → repoauditor-0.2.8}/PKG-INFO +1 -1
  2. {repoauditor-0.2.7 → repoauditor-0.2.8}/pyproject.toml +1 -1
  3. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/EntryPoint.py +1 -5
  4. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/ExecuteModules.py +62 -60
  5. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionQuery.py +1 -1
  6. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/Module.py +1 -1
  7. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/__init__.py +1 -1
  8. {repoauditor-0.2.7 → repoauditor-0.2.8}/.copier-answers.yml +0 -0
  9. {repoauditor-0.2.7 → repoauditor-0.2.8}/.github/CODEOWNERS +0 -0
  10. {repoauditor-0.2.7 → repoauditor-0.2.8}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  11. {repoauditor-0.2.7 → repoauditor-0.2.8}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  12. {repoauditor-0.2.7 → repoauditor-0.2.8}/.github/ISSUE_TEMPLATE/custom.md +0 -0
  13. {repoauditor-0.2.7 → repoauditor-0.2.8}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  14. {repoauditor-0.2.7 → repoauditor-0.2.8}/.github/actions/release_impl/action.yml +0 -0
  15. {repoauditor-0.2.7 → repoauditor-0.2.8}/.github/pull_request_template.md +0 -0
  16. {repoauditor-0.2.7 → repoauditor-0.2.8}/.github/release_sources.yaml +0 -0
  17. {repoauditor-0.2.7 → repoauditor-0.2.8}/.github/workflows/CICD.yml +0 -0
  18. {repoauditor-0.2.7 → repoauditor-0.2.8}/.github/workflows/CICD_impl.yml +0 -0
  19. {repoauditor-0.2.7 → repoauditor-0.2.8}/.github/workflows/codeql.yml +0 -0
  20. {repoauditor-0.2.7 → repoauditor-0.2.8}/.gitignore +0 -0
  21. {repoauditor-0.2.7 → repoauditor-0.2.8}/.pre-commit-config.yaml +0 -0
  22. {repoauditor-0.2.7 → repoauditor-0.2.8}/.python-version +0 -0
  23. {repoauditor-0.2.7 → repoauditor-0.2.8}/CODE_OF_CONDUCT.md +0 -0
  24. {repoauditor-0.2.7 → repoauditor-0.2.8}/CONTRIBUTING.md +0 -0
  25. {repoauditor-0.2.7 → repoauditor-0.2.8}/DEVELOPMENT.md +0 -0
  26. {repoauditor-0.2.7 → repoauditor-0.2.8}/GOVERNANCE.md +0 -0
  27. {repoauditor-0.2.7 → repoauditor-0.2.8}/LICENSE +0 -0
  28. {repoauditor-0.2.7 → repoauditor-0.2.8}/MAINTAINERS.md +0 -0
  29. {repoauditor-0.2.7 → repoauditor-0.2.8}/README.md +0 -0
  30. {repoauditor-0.2.7 → repoauditor-0.2.8}/SECURITY.md +0 -0
  31. {repoauditor-0.2.7 → repoauditor-0.2.8}/minisign_key.pub +0 -0
  32. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/AutoGitSemVer.yaml +0 -0
  33. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/CommandLineProcessor.py +0 -0
  34. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Impl/ParallelSequentialProcessor.py +0 -0
  35. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Impl/__init__.py +0 -0
  36. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Module.py +0 -0
  37. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugin.py +0 -0
  38. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/AllowDeletions.py +0 -0
  39. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/AllowForcePushes.py +0 -0
  40. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/DismissStalePullRequestApprovals.py +0 -0
  41. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/DoNotAllowBypassSettings.py +0 -0
  42. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/EnsureStatusChecks.py +0 -0
  43. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/ClassicEnableRequirementImpl.py +0 -0
  44. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/ClassicValueRequirementImpl.py +0 -0
  45. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/__init__.py +0 -0
  46. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireApprovalMostRecentPush.py +0 -0
  47. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireApprovals.py +0 -0
  48. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireCodeOwnerReview.py +0 -0
  49. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireConversationResolution.py +0 -0
  50. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireLinearHistory.py +0 -0
  51. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequirePullRequests.py +0 -0
  52. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireSignedCommits.py +0 -0
  53. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireStatusChecksToPass.py +0 -0
  54. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireUpToDateBranches.py +0 -0
  55. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/__init__.py +0 -0
  56. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/DefaultBranchQuery.py +0 -0
  57. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/DefaultBranchQueryRequirements/Protected.py +0 -0
  58. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/DefaultBranchQueryRequirements/__init__.py +0 -0
  59. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/Impl/Common.py +0 -0
  60. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/Impl/EnableRequirementImpl.py +0 -0
  61. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/Impl/ValueRequirementImpl.py +0 -0
  62. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/Impl/__init__.py +0 -0
  63. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQuery.py +0 -0
  64. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/AutoMerge.py +0 -0
  65. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/DefaultBranch.py +0 -0
  66. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/DeleteHeadBranches.py +0 -0
  67. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/DependabotSecurityUpdates.py +0 -0
  68. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/Description.py +0 -0
  69. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/Impl/StandardEnableRequirementImpl.py +0 -0
  70. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/Impl/StandardValueRequirementImpl.py +0 -0
  71. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/Impl/__init__.py +0 -0
  72. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/License.py +0 -0
  73. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/MergeCommit.py +0 -0
  74. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/MergeCommitMessage.py +0 -0
  75. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/Private.py +0 -0
  76. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/RebaseMergeCommit.py +0 -0
  77. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SecretScanning.py +0 -0
  78. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SecretScanningPushProtection.py +0 -0
  79. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SquashCommitMerge.py +0 -0
  80. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SquashMergeCommitMessage.py +0 -0
  81. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SuggestUpdatingPullRequestBranches.py +0 -0
  82. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SupportDiscussions.py +0 -0
  83. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SupportIssues.py +0 -0
  84. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SupportProjects.py +0 -0
  85. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SupportWikis.py +0 -0
  86. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/TemplateRepository.py +0 -0
  87. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/WebCommitSignoff.py +0 -0
  88. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/__init__.py +0 -0
  89. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHub/__init__.py +0 -0
  90. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/GitHubPlugin.py +0 -0
  91. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Plugins/__init__.py +0 -0
  92. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Query.py +0 -0
  93. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/Requirement.py +0 -0
  94. {repoauditor-0.2.7 → repoauditor-0.2.8}/src/RepoAuditor/py.typed +0 -0
  95. {repoauditor-0.2.7 → repoauditor-0.2.8}/tests/CommandLineProcessor_UnitTest.py +0 -0
  96. {repoauditor-0.2.7 → repoauditor-0.2.8}/tests/EntryPoint_UnitTest.py +0 -0
  97. {repoauditor-0.2.7 → repoauditor-0.2.8}/tests/ExecuteModules_UnitTest.py +0 -0
  98. {repoauditor-0.2.7 → repoauditor-0.2.8}/tests/Module_UnitTest.py +0 -0
  99. {repoauditor-0.2.7 → repoauditor-0.2.8}/tests/Plugin_UnitTest.py +0 -0
  100. {repoauditor-0.2.7 → repoauditor-0.2.8}/tests/Plugins/GitHubModule_UnitTest.py +0 -0
  101. {repoauditor-0.2.7 → repoauditor-0.2.8}/tests/Plugins/GitHub_EndToEndTest.py +0 -0
  102. {repoauditor-0.2.7 → repoauditor-0.2.8}/tests/Plugins/__snapshots__/GitHub_EndToEndTest.ambr +0 -0
  103. {repoauditor-0.2.7 → repoauditor-0.2.8}/tests/Plugins/utilities.py +0 -0
  104. {repoauditor-0.2.7 → repoauditor-0.2.8}/tests/Query_UnitTest.py +0 -0
  105. {repoauditor-0.2.7 → repoauditor-0.2.8}/tests/Requirement_UnitTest.py +0 -0
  106. {repoauditor-0.2.7 → repoauditor-0.2.8}/tests/__snapshots__/ExecuteModules_UnitTest.ambr +0 -0
  107. {repoauditor-0.2.7 → repoauditor-0.2.8}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: RepoAuditor
3
- Version: 0.2.7
3
+ Version: 0.2.8
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
@@ -109,7 +109,7 @@ select = [
109
109
  "RSE",
110
110
  "RET",
111
111
  "SLF",
112
- # "SIM", # 4
112
+ "SIM",
113
113
  "SLOT",
114
114
  # "TID", # 9
115
115
  "TD",
@@ -293,11 +293,7 @@ def EntryPoint(
293
293
  display_rationale=not no_rationale,
294
294
  )
295
295
  except Exception as ex:
296
- if dm.is_debug:
297
- error = traceback.format_exc()
298
- else:
299
- error = str(ex)
300
-
296
+ error = traceback.format_exc() if dm.is_debug else str(ex)
301
297
  dm.WriteError(error)
302
298
 
303
299
 
@@ -179,69 +179,71 @@ def Execute(
179
179
  all_results[all_results_index] = transformed_results
180
180
 
181
181
  for index, (all_results_index, module_info) in enumerate(sequential):
182
- with modules_dm.Nested(
183
- "Processing '{}' ({} of {})...".format(
184
- module_info.module.name,
185
- index + 1 + len(parallel),
186
- len(module_infos),
187
- ),
188
- ) as this_module_dm:
182
+ with (
183
+ modules_dm.Nested(
184
+ "Processing '{}' ({} of {})...".format(
185
+ module_info.module.name,
186
+ index + 1 + len(parallel),
187
+ len(module_infos),
188
+ ),
189
+ ) as this_module_dm,
189
190
  # rich.progress needs to output to sys.stdout
190
- with this_module_dm.YieldStdout() as stdout_context:
191
- stdout_context.persist_content = False
192
-
193
- # Technically speaking, it would be more correct to use `stdout_context.stream` here
194
- # rather than referencing `sys.stdout` directly, but it is really hard to work with mocked
195
- # stream as mocks will create mocks for everything called on the mock. Use sys.stdout
196
- # directly to avoid that particular problem.
197
- from unittest.mock import Mock, MagicMock
198
-
199
- assert stdout_context.stream is sys.stdout or isinstance(
200
- stdout_context.stream, (Mock, MagicMock)
201
- ), stdout_context.stream
202
-
203
- with Progress(
204
- *Progress.get_default_columns(),
205
- TimeElapsedColumn(),
206
- "{task.fields[status]}",
207
- console=Capabilities.Get(sys.stdout).CreateRichConsole(sys.stdout),
208
- transient=True,
209
- refresh_per_second=10,
210
- ) as progress_bar:
211
- progress_bar_task_id = progress_bar.add_task(
212
- stdout_context.line_prefix,
213
- status="",
214
- total=module_info.module.GetNumRequirements(),
215
- visible=True,
191
+ this_module_dm.YieldStdout() as stdout_context,
192
+ ):
193
+ stdout_context.persist_content = False
194
+
195
+ # Technically speaking, it would be more correct to use `stdout_context.stream` here
196
+ # rather than referencing `sys.stdout` directly, but it is really hard to work with mocked
197
+ # stream as mocks will create mocks for everything called on the mock. Use sys.stdout
198
+ # directly to avoid that particular problem.
199
+ from unittest.mock import Mock, MagicMock
200
+
201
+ assert stdout_context.stream is sys.stdout or isinstance(
202
+ stdout_context.stream, (Mock, MagicMock)
203
+ ), stdout_context.stream
204
+
205
+ with Progress(
206
+ *Progress.get_default_columns(),
207
+ TimeElapsedColumn(),
208
+ "{task.fields[status]}",
209
+ console=Capabilities.Get(sys.stdout).CreateRichConsole(sys.stdout),
210
+ transient=True,
211
+ refresh_per_second=10,
212
+ ) as progress_bar:
213
+ progress_bar_task_id = progress_bar.add_task(
214
+ stdout_context.line_prefix,
215
+ status="",
216
+ total=module_info.module.GetNumRequirements(),
217
+ visible=True,
218
+ )
219
+
220
+ # ----------------------------------------------------------------------
221
+ def OnStatus(
222
+ num_completed: int,
223
+ num_success: int,
224
+ num_error: int,
225
+ num_warning: int,
226
+ num_does_not_apply: int,
227
+ ) -> None:
228
+ progress_bar.update(
229
+ progress_bar_task_id,
230
+ completed=num_completed,
231
+ status=_CreateStatusString(
232
+ num_success,
233
+ num_error,
234
+ num_warning,
235
+ num_does_not_apply,
236
+ ),
216
237
  )
217
238
 
218
- # ----------------------------------------------------------------------
219
- def OnStatus(
220
- num_completed: int,
221
- num_success: int,
222
- num_error: int,
223
- num_warning: int,
224
- num_does_not_apply: int,
225
- ) -> None:
226
- progress_bar.update(
227
- progress_bar_task_id,
228
- completed=num_completed,
229
- status=_CreateStatusString(
230
- num_success,
231
- num_error,
232
- num_warning,
233
- num_does_not_apply,
234
- ),
235
- )
236
-
237
- # ----------------------------------------------------------------------
238
-
239
- evaluate_results = Evaluate(module_info, OnStatus)
240
-
241
- assert all_results[all_results_index] is None
242
- all_results[all_results_index] = evaluate_results
243
-
244
- this_module_dm.result = CalcResultInfo(evaluate_results)[0]
239
+ # ----------------------------------------------------------------------
240
+
241
+ evaluate_results = Evaluate(module_info, OnStatus)
242
+
243
+ assert all_results[all_results_index] is None
244
+ all_results[all_results_index] = evaluate_results
245
+
246
+ this_module_dm.result = CalcResultInfo(evaluate_results)[0]
245
247
 
246
248
  final_results: list[list[Module.EvaluateInfo]] = []
247
249
 
@@ -117,7 +117,7 @@ class ClassicBranchProtectionQuery(Query):
117
117
  self,
118
118
  module_data: dict[str, Any],
119
119
  ) -> Optional[dict[str, Any]]:
120
- branch = module_data.get("branch", None)
120
+ branch = module_data.get("branch")
121
121
  if branch is None:
122
122
  # Get the default branch name
123
123
  response = module_data["session"].get("")
@@ -69,7 +69,7 @@ class GitHubModule(Module):
69
69
  # ----------------------------------------------------------------------
70
70
  @override
71
71
  def GenerateInitialData(self, dynamic_args: dict[str, Any]) -> Optional[dict[str, Any]]:
72
- dynamic_args["session"] = _GitHubSession(dynamic_args["url"], dynamic_args.get("pat", None))
72
+ dynamic_args["session"] = _GitHubSession(dynamic_args["url"], dynamic_args.get("pat"))
73
73
 
74
74
  return dynamic_args
75
75
 
@@ -3,4 +3,4 @@ APP_NAME = "RepoAuditor"
3
3
  # Note that this value will be overwritten by calls to `python ../../Build.py update_version` based
4
4
  # on changes observed in the git repository. The default value below will be used until the value
5
5
  # here is explicitly updated by the Continuous Integration system.
6
- __version__ = "0.2.7"
6
+ __version__ = "0.2.8"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes