haraka 0.2.29__py3-none-any.whl → 0.2.30__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.
@@ -95,27 +95,36 @@ class ResourcePurger:
95
95
  else:
96
96
  self._log.debug(f"Found {len(all_paths)} paths under {root})")
97
97
 
98
- matches, non_matches, directories_skipped = [], [], []
98
+ matches, non_matched_files, directories_skipped, non_matched_dirs = [], [], [], []
99
99
  for path in all_paths:
100
100
  self._log.debug(f"\nScanning path: {path}")
101
101
  rel = path.relative_to(root).as_posix()
102
102
  self._log.debug(f"Relative path for inspection: {rel}")
103
-
104
103
  # Match file against the PathSpec
105
104
  if spec.match_file(rel):
106
105
  self._log.debug(f"✅ KEEP: Path matches keep patterns: {rel}")
107
106
  matches.append(path) # Collect paths to keep
108
- continue
107
+ else:
108
+ if path.is_dir():
109
+ if self._is_dir_protected(rel, spec):
110
+ self._log.debug(f"{"⏭️ SKIPPING DELETE: Protected ancestor found: %s", path}")
111
+ directories_skipped.append(rel)
112
+ else:
113
+ self._log.debug(f"{"❌ DELETE DIR: %s", rel}")
114
+ non_matched_dirs.append(rel)
115
+ else:
116
+ non_matched_files.append(rel)
117
+ self._f.remove_file(path)
118
+ self._log.debug(f"{"❌ DELETE FILE: %s", rel}")
119
+
120
+
109
121
 
110
122
  # Non-matching paths: collect and delete
111
123
  self._log.debug(f"❌ DELETE: Path does not match keep patterns: {rel}")
124
+
112
125
  if path.is_dir():
113
126
  directories_skipped.append(path)
114
127
  self._log.debug(f"⏭️ SKIPPING DELETE: Path is a directory: {path}")
115
- else:
116
- non_matches.append(path)
117
- self._f.remove_file(path)
118
- self._log.debug(f"Deleted file: {path}")
119
128
 
120
129
  # Print results cleanly for debugging/logging purposes
121
130
  self._log.info("\nMATCHED PATHS:")
@@ -125,6 +134,15 @@ class ResourcePurger:
125
134
 
126
135
  self._log.info("\nNOT MATCHED PATHS:")
127
136
  self._log.info("=" * 80)
128
- for non_match in non_matches:
137
+ for non_match in non_matched_files:
129
138
  self._log.info(f"❌ {non_match}")
130
139
 
140
+ @staticmethod
141
+ def _is_dir_protected(relative_path: str, spec: PathSpec) -> bool:
142
+ """
143
+ Walks from `path` up to `root`, and returns True if any ancestor
144
+ is matched by the spec.
145
+ """
146
+ if spec.match_file(relative_path):
147
+ return True
148
+ return False
@@ -2,12 +2,15 @@ variant: java-springboot
2
2
 
3
3
  keep:
4
4
  # ── application source ────────────────────────────
5
+ - src/
6
+ - src/main/
5
7
  - src/main/java/
6
8
  - src/main/java/**
7
9
  - src/main/resources/
8
10
  - src/main/resources/**
9
11
 
10
12
  # ── tests ─────────────────────────────────────────
13
+ - src/test/
11
14
  - src/test/java/
12
15
  - src/test/java/**
13
16
 
@@ -18,6 +21,7 @@ keep:
18
21
  - README.md
19
22
 
20
23
  # ── IDE / run configs ─────────────────────────────
24
+ - runConfigurations/
21
25
  - runConfigurations/SpringBoot/
22
26
  - runConfigurations/SpringBoot/**
23
27
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: haraka
3
- Version: 0.2.29
3
+ Version: 0.2.30
4
4
  Summary: Reusable post-generation helper for Cookiecutter micro-service templates
5
5
  Author-email: Will Burks <will@example.com>
6
6
  License: MIT
@@ -17,7 +17,7 @@ haraka/post_gen/service/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
17
17
  haraka/post_gen/service/command.py,sha256=yvEzW9rMSXWeQ_2DXuQNtGH6sRuZnK6viMud-amFQXw,2348
18
18
  haraka/post_gen/service/fileOps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
19
  haraka/post_gen/service/fileOps/files.py,sha256=Jm_0bhvVnNqSPGKQ2RnMpx8JLV74M-IXMmwly9fpmVw,3020
20
- haraka/post_gen/service/fileOps/purge.py,sha256=rwqwA6W57f5yRmVGKwbu4CVp4ChkVBKN01Eki4dOal0,4870
20
+ haraka/post_gen/service/fileOps/purge.py,sha256=ZvmpmC38SMhppBGRck_z8qlie4ncULlFnQJ5zOoJkdc,5639
21
21
  haraka/post_gen/service/gitOps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  haraka/post_gen/service/gitOps/gitops.py,sha256=clWny1m9qB4yr8asba8JwqBjewlMVsJUmIOCLtAL8RI,4052
23
23
  haraka/utils/__init__.py,sha256=3Cp4u0dyAGcmqes-tIr95KFsNsJx5Ji5Yzkto9546Hs,168
@@ -27,9 +27,9 @@ haraka/utils/logging/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
27
27
  haraka/utils/logging/log_util.py,sha256=UQq2E24q3brvXqcyGCjfSxxHH48JF_BMg54TKdl1SHk,1049
28
28
  haraka/utils/manifests/go-grpc-gateway-buf.yml,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
29
  haraka/utils/manifests/go-grpc-protoc.yml,sha256=OaQlfW_S_OguhW_UcpBVdqdEtUMlg-SrT4bqLhQrY7Y,936
30
- haraka/utils/manifests/java-springboot.yml,sha256=WzcaStDgzyWmBhV2TUiYEkxHhYwydN9ww2yjZYyhSmw,929
30
+ haraka/utils/manifests/java-springboot.yml,sha256=DTZoVrIDNVpq2AuuXjL2jAvPggeKWVuKJEKwFb90cz4,989
31
31
  haraka/utils/manifests/python-fastapi.yml,sha256=nhO6S9j_r-S10nM8nuw7PtR247-ePhBXHvaXg74CjWw,922
32
- haraka-0.2.29.dist-info/METADATA,sha256=0l2YErZj6uK53j3Kon2Q5OwN-p7BukzVLwoZxeQJhyM,579
33
- haraka-0.2.29.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
34
- haraka-0.2.29.dist-info/top_level.txt,sha256=1khpwypLKWoklVd_CgFiwAfcctVSXRoRPc3BI9lyIXo,7
35
- haraka-0.2.29.dist-info/RECORD,,
32
+ haraka-0.2.30.dist-info/METADATA,sha256=hvMTjKi3D_CKzU8Qb27r4xN9_nUHn5OsWx9HAeMTSSw,579
33
+ haraka-0.2.30.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
34
+ haraka-0.2.30.dist-info/top_level.txt,sha256=1khpwypLKWoklVd_CgFiwAfcctVSXRoRPc3BI9lyIXo,7
35
+ haraka-0.2.30.dist-info/RECORD,,