crackerjack 0.33.8__py3-none-any.whl → 0.33.10__py3-none-any.whl

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.

Potentially problematic release.


This version of crackerjack might be problematic. Click here for more details.

@@ -65,7 +65,13 @@ class ConfigMergeService(ConfigMergeServiceProtocol):
65
65
  target_path = Path(target_path)
66
66
 
67
67
  if not target_path.exists():
68
- return source_content
68
+ # Process source content for project-specific references
69
+ processed_source = copy.deepcopy(source_content)
70
+ source_repos = processed_source.get("repos", [])
71
+ processed_source["repos"] = self._process_pre_commit_repos_for_project(
72
+ source_repos, project_name
73
+ )
74
+ return processed_source
69
75
 
70
76
  with target_path.open() as f:
71
77
  loaded_config = yaml.safe_load(f)
@@ -96,7 +102,11 @@ class ConfigMergeService(ConfigMergeServiceProtocol):
96
102
  ]
97
103
 
98
104
  if new_repos:
99
- target_repos.extend(new_repos)
105
+ # Replace project-specific references in new repos before adding them
106
+ processed_new_repos = self._process_pre_commit_repos_for_project(
107
+ new_repos, project_name
108
+ )
109
+ target_repos.extend(processed_new_repos)
100
110
  target_content["repos"] = target_repos
101
111
  self.logger.info(
102
112
  "Merged .pre-commit-config.yaml",
@@ -485,3 +495,46 @@ class ConfigMergeService(ConfigMergeServiceProtocol):
485
495
  for key, val in value.items()
486
496
  }
487
497
  return value
498
+
499
+ def _process_pre_commit_repos_for_project(
500
+ self, repos: list[dict[str, t.Any]], project_name: str
501
+ ) -> list[dict[str, t.Any]]:
502
+ """Process pre-commit repos to replace project-specific references."""
503
+ if project_name == "crackerjack":
504
+ return repos # No changes needed for crackerjack itself
505
+
506
+ processed_repos = []
507
+ for repo in repos:
508
+ processed_repo = copy.deepcopy(repo)
509
+
510
+ # Process hooks within each repo
511
+ hooks = processed_repo.get("hooks", [])
512
+ for hook in hooks:
513
+ if isinstance(hook, dict):
514
+ # Replace crackerjack directory references in args
515
+ if "args" in hook:
516
+ hook["args"] = [
517
+ arg.replace("crackerjack", project_name)
518
+ if isinstance(arg, str)
519
+ else arg
520
+ for arg in hook["args"]
521
+ ]
522
+
523
+ # Replace crackerjack directory references in files pattern
524
+ if "files" in hook:
525
+ files_pattern = hook["files"]
526
+ if isinstance(files_pattern, str):
527
+ hook["files"] = files_pattern.replace(
528
+ "^crackerjack/", f"^{project_name}/"
529
+ )
530
+
531
+ # Special handling for validate-regex-patterns hook - keep it pointing to crackerjack package
532
+ if hook.get("id") == "validate-regex-patterns":
533
+ # This should reference the installed crackerjack package, not the current project
534
+ # The entry already uses "uv run python -m crackerjack.tools.validate_regex_patterns"
535
+ # which is correct - it runs from the installed crackerjack package
536
+ pass
537
+
538
+ processed_repos.append(processed_repo)
539
+
540
+ return processed_repos
@@ -138,7 +138,9 @@ class InitializationService:
138
138
  self._process_mcp_config(target_path, force, results)
139
139
  return
140
140
 
141
- source_file = self.pkg_path.parent / file_name
141
+ # Use crackerjack's project root for template files
142
+ crackerjack_project_root = Path(__file__).parent.parent.parent
143
+ source_file = crackerjack_project_root / file_name
142
144
  target_file = target_path / file_name
143
145
 
144
146
  if not source_file.exists():
@@ -304,7 +306,9 @@ class InitializationService:
304
306
  force: bool,
305
307
  results: dict[str, t.Any],
306
308
  ) -> None:
307
- source_file = self.pkg_path / "example.mcp.json"
309
+ # Use crackerjack's project root for template files
310
+ crackerjack_project_root = Path(__file__).parent.parent.parent
311
+ source_file = crackerjack_project_root / "example.mcp.json"
308
312
 
309
313
  target_file = target_path / ".mcp.json"
310
314
 
@@ -644,7 +644,7 @@ def validate_and_sanitize_string(value: str, **kwargs: t.Any) -> str:
644
644
 
645
645
  def validate_and_sanitize_path(value: str | Path, **kwargs: t.Any) -> Path:
646
646
  validator = SecureInputValidator()
647
- result = validator.sanitizer.sanitize_string(str(value), **kwargs)
647
+ result = validator.sanitizer.sanitize_path(value, **kwargs)
648
648
 
649
649
  if not result.valid:
650
650
  raise ExecutionError(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: crackerjack
3
- Version: 0.33.8
3
+ Version: 0.33.10
4
4
  Summary: Crackerjack Python project management tool
5
5
  Project-URL: documentation, https://github.com/lesleslie/crackerjack
6
6
  Project-URL: homepage, https://github.com/lesleslie/crackerjack
@@ -159,7 +159,7 @@ crackerjack/services/cache.py,sha256=FutQKxItKSdQFzOlWQaQzVBEfn6lbPXCDdvNnz3NCDQ
159
159
  crackerjack/services/changelog_automation.py,sha256=KUeXCYLihRfLR0mUIRiI2aRQdCfe-45GnbB2gYNJJQE,14095
160
160
  crackerjack/services/config.py,sha256=Jseaw8bVRxLlMKo2zrEiTO2PPSK1CrlZJYlGFNKZRJ4,13182
161
161
  crackerjack/services/config_integrity.py,sha256=Ac6-c7WuupsyrP2dxx_ijgjzpNnx9G0NWsXB-SZjelg,2904
162
- crackerjack/services/config_merge.py,sha256=jeyvRHSjGnPT7p2EKKJZKpx_A7Q1o4Bgvofu_tXGLfg,16263
162
+ crackerjack/services/config_merge.py,sha256=FPh4u4J68JkNVf0AT1paNeEy2MjusSbYu9kN72LzR9w,18825
163
163
  crackerjack/services/config_template.py,sha256=RgSYFVNBxdBfMitlRqz7bzkEHaQhEWMm3pUMS7maRFU,18035
164
164
  crackerjack/services/contextual_ai_assistant.py,sha256=6Pnb2r824c4JYkP5mtCH8sJ2OPPvI-KtzbXcosspCfE,19962
165
165
  crackerjack/services/coverage_badge_service.py,sha256=gzC3LEyVLt4rpf378APsFVRGgNwkLc50w9S_9xEPPoM,6645
@@ -177,8 +177,8 @@ crackerjack/services/filesystem.py,sha256=nmL3mYqylS_BSQpwFbC7EMHoA44K5qUxa9CPg1
177
177
  crackerjack/services/git.py,sha256=g0D9K7PFGWiv_-CbPXEhGtxJVJccEsshYNEmGstjXss,12716
178
178
  crackerjack/services/health_metrics.py,sha256=KmwFlvcB-Pb8DnDI0IRV9ETDdp_vJTaGlhJ_HmBL2YY,21538
179
179
  crackerjack/services/heatmap_generator.py,sha256=zz5V-zXPfoCGNXoj7iuyOeFuDRRUhFpxuENUnd0X75g,26200
180
- crackerjack/services/initialization.py,sha256=oq0D9AZtLufvIP8sNOVayaEhW9PAhXb7NFHFcd2RHjs,25772
181
- crackerjack/services/input_validator.py,sha256=N2ONa0C2tke4H4MH9kY1j21kMab0PO4iPJCHBZE8jx8,22269
180
+ crackerjack/services/initialization.py,sha256=_ZjGpIG5eGHzrVXCxlhlouhY-E-4OITEln1GDTswZ6s,26049
181
+ crackerjack/services/input_validator.py,sha256=Botr3ottp9InSw163QaFrNfy0kM_STsJdWBbjsCX96M,22262
182
182
  crackerjack/services/intelligent_commit.py,sha256=HfryPb8ieDPcirPQm1ZYGihZMhAx-n3qv88UAaeFUuE,11307
183
183
  crackerjack/services/log_manager.py,sha256=GzZJ_lwbvuj8JscnvqR2TsQ1XHrX6PturqZ6wJCkFLo,8578
184
184
  crackerjack/services/logging.py,sha256=aHHrK7Hnke-pqulyJHIoqfymHVyPc5Fxp0WQX_cvbD8,5390
@@ -222,8 +222,8 @@ crackerjack/slash_commands/status.md,sha256=U3qqppVLtIIm2lEiMYaKagaHYLI9UplL7OH1
222
222
  crackerjack/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
223
223
  crackerjack/tools/validate_input_validator_patterns.py,sha256=NN7smYlXWrHLQXTb-81gRam2vjW-cJav92f1klPA0qA,8234
224
224
  crackerjack/tools/validate_regex_patterns.py,sha256=y2pAp2BzfSC_3XYMIKGMpQFwwwDidPy3k2Y2almOy74,5811
225
- crackerjack-0.33.8.dist-info/METADATA,sha256=9IduqdhiN8pHCwCqt6jI4h_4wqTzrIzPKCNr-Hgyi2Y,37942
226
- crackerjack-0.33.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
227
- crackerjack-0.33.8.dist-info/entry_points.txt,sha256=AJKNft0WXm9xoGUJ3Trl-iXHOWxRAYbagQiza3AILr4,57
228
- crackerjack-0.33.8.dist-info/licenses/LICENSE,sha256=fDt371P6_6sCu7RyqiZH_AhT1LdN3sN1zjBtqEhDYCk,1531
229
- crackerjack-0.33.8.dist-info/RECORD,,
225
+ crackerjack-0.33.10.dist-info/METADATA,sha256=V0lM9-pnKl03VtfsQgR2xwoAlRcMjeJEyxRA-3D7vlw,37943
226
+ crackerjack-0.33.10.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
227
+ crackerjack-0.33.10.dist-info/entry_points.txt,sha256=AJKNft0WXm9xoGUJ3Trl-iXHOWxRAYbagQiza3AILr4,57
228
+ crackerjack-0.33.10.dist-info/licenses/LICENSE,sha256=fDt371P6_6sCu7RyqiZH_AhT1LdN3sN1zjBtqEhDYCk,1531
229
+ crackerjack-0.33.10.dist-info/RECORD,,