cycode 3.4.1.dev6__py3-none-any.whl → 3.4.2.dev1__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.
cycode/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = '3.4.1.dev6' # DON'T TOUCH. Placeholder. Will be filled automatically on poetry build from Git Tag
1
+ __version__ = '3.4.2.dev1' # DON'T TOUCH. Placeholder. Will be filled automatically on poetry build from Git Tag
@@ -282,7 +282,11 @@ def _scan_secret_pre_commit(ctx: typer.Context, repo_path: str) -> None:
282
282
  for diff in diff_index:
283
283
  progress_bar.update(ScanProgressBarSection.PREPARE_LOCAL_FILES)
284
284
  documents_to_scan.append(
285
- Document(get_path_by_os(get_diff_file_path(diff)), get_diff_file_content(diff), is_git_diff_format=True)
285
+ Document(
286
+ get_path_by_os(get_diff_file_path(diff, repo=repo)),
287
+ get_diff_file_content(diff),
288
+ is_git_diff_format=True,
289
+ )
286
290
  )
287
291
  documents_to_scan = excluder.exclude_irrelevant_documents_to_scan(consts.SECRET_SCAN_TYPE, documents_to_scan)
288
292
 
@@ -87,7 +87,7 @@ def collect_commit_range_diff_documents(
87
87
  for diff in diff_index:
88
88
  commit_documents_to_scan.append(
89
89
  Document(
90
- path=get_path_by_os(get_diff_file_path(diff)),
90
+ path=get_path_by_os(get_diff_file_path(diff, repo=repo)),
91
91
  content=get_diff_file_content(diff),
92
92
  is_git_diff_format=True,
93
93
  unique_id=commit_id,
@@ -166,7 +166,7 @@ def get_commit_range_modified_documents(
166
166
  for diff in modified_files_diff:
167
167
  progress_bar.update(progress_bar_section)
168
168
 
169
- file_path = get_path_by_os(get_diff_file_path(diff))
169
+ file_path = get_path_by_os(get_diff_file_path(diff, repo=repo))
170
170
 
171
171
  diff_documents.append(
172
172
  Document(
@@ -211,16 +211,24 @@ def parse_pre_receive_input() -> str:
211
211
  return pre_receive_input.splitlines()[0]
212
212
 
213
213
 
214
- def get_diff_file_path(diff: 'Diff', relative: bool = False) -> Optional[str]:
214
+ def get_diff_file_path(diff: 'Diff', relative: bool = False, repo: Optional['Repo'] = None) -> Optional[str]:
215
215
  if relative:
216
216
  # relative to the repository root
217
217
  return diff.b_path if diff.b_path else diff.a_path
218
218
 
219
+ # Try blob-based paths first (most reliable when available)
219
220
  if diff.b_blob:
220
221
  return diff.b_blob.abspath
221
222
  if diff.a_blob:
222
223
  return diff.a_blob.abspath
223
224
 
225
+ # Fallback: construct an absolute path from a relative path
226
+ # This handles renames and other cases where blobs might be None
227
+ if repo and repo.working_tree_dir:
228
+ target_path = diff.b_path if diff.b_path else diff.a_path
229
+ if target_path:
230
+ return os.path.abspath(os.path.join(repo.working_tree_dir, target_path))
231
+
224
232
  return None
225
233
 
226
234
 
@@ -244,7 +252,7 @@ def get_pre_commit_modified_documents(
244
252
  for diff in diff_index:
245
253
  progress_bar.update(progress_bar_section)
246
254
 
247
- file_path = get_path_by_os(get_diff_file_path(diff))
255
+ file_path = get_path_by_os(get_diff_file_path(diff, repo=repo))
248
256
 
249
257
  diff_documents.append(
250
258
  Document(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cycode
3
- Version: 3.4.1.dev6
3
+ Version: 3.4.2.dev1
4
4
  Summary: Boost security in your dev lifecycle via SAST, SCA, Secrets & IaC scanning.
5
5
  Home-page: https://github.com/cycodehq/cycode-cli
6
6
  License: MIT
@@ -277,7 +277,7 @@ Perform the following steps to install the pre-commit hook:
277
277
  ```yaml
278
278
  repos:
279
279
  - repo: https://github.com/cycodehq/cycode-cli
280
- rev: v3.2.0
280
+ rev: v3.4.2
281
281
  hooks:
282
282
  - id: cycode
283
283
  stages:
@@ -289,7 +289,7 @@ Perform the following steps to install the pre-commit hook:
289
289
  ```yaml
290
290
  repos:
291
291
  - repo: https://github.com/cycodehq/cycode-cli
292
- rev: v3.2.0
292
+ rev: v3.4.2
293
293
  hooks:
294
294
  - id: cycode
295
295
  stages:
@@ -1,4 +1,4 @@
1
- cycode/__init__.py,sha256=-TrTs9M9MHAFZ48vOTByuUeyddcuTIgtkv3DXotvAfs,114
1
+ cycode/__init__.py,sha256=tyk-cmPAYJh__0HAgSy_VEBt6aZM1W1sW8kKzQPjso0,114
2
2
  cycode/__main__.py,sha256=Z3bD5yrA7yPvAChcADQrqCaZd0ChGI1gdiwALwbWJ6U,104
3
3
  cycode/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  cycode/cli/app.py,sha256=UC5A5TKIvlxOYKERfJykN8apTT0VyMY5pUjRh_LM-dw,6098
@@ -36,7 +36,7 @@ cycode/cli/apps/scan/aggregation_report.py,sha256=8f9kPfO7biNf5OsDZG6UhMPqG6ymoF
36
36
  cycode/cli/apps/scan/code_scanner.py,sha256=lWAcdtdeOmLe9zaXnItlbL-WIgnJ6d4iUeYiprxUJ34,11205
37
37
  cycode/cli/apps/scan/commit_history/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
38
  cycode/cli/apps/scan/commit_history/commit_history_command.py,sha256=Yp_17vfjDqytjCqjXQ73HaDGH5_ertoLhoV7Cvt1Hhw,1104
39
- cycode/cli/apps/scan/commit_range_scanner.py,sha256=pFw5rfo9WHyKoBavRa0F8F9Jv5I8OXDI9A_VawoQJ_o,12865
39
+ cycode/cli/apps/scan/commit_range_scanner.py,sha256=EMNadSkuetnEFlJHvnaXZJfZlSewK3tLjPu21JWS6g4,12939
40
40
  cycode/cli/apps/scan/detection_excluder.py,sha256=0zaNa1PxVshATHv8axp4e-xWvmuNQdg_r5DYsdQ9EVo,6432
41
41
  cycode/cli/apps/scan/path/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
42
  cycode/cli/apps/scan/path/path_command.py,sha256=7M8nnohjB4SaNA7jv3mFODyX1wwwSmROe45e7E5GLbY,670
@@ -70,7 +70,7 @@ cycode/cli/exceptions/handle_errors.py,sha256=9ZiDbHswXLe0TscUqZL9Or5Jq2AlYtzGb6
70
70
  cycode/cli/exceptions/handle_report_sbom_errors.py,sha256=bi0EizHtQLL-ovhHRH98CZ7qXdDPLTYnI59Jn1Y5c0E,926
71
71
  cycode/cli/exceptions/handle_scan_errors.py,sha256=-QIYvbBXmZVOvAdNwGYwAdmBma6Z_pPpS0a77aDICp8,1916
72
72
  cycode/cli/files_collector/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
73
- cycode/cli/files_collector/commit_range_documents.py,sha256=qDW30yH8QzS9mveexM8gTDjgRcHnOWdv6C4nDa_wejQ,11968
73
+ cycode/cli/files_collector/commit_range_documents.py,sha256=rEdvXzO_wue3Tpt0-E-o_GqN12yRGxZvJ0tRmEmQX7U,12444
74
74
  cycode/cli/files_collector/file_excluder.py,sha256=FhBnYF889BOwx3fRjNyBaFix6-65jCejglf8MmiVxSk,7300
75
75
  cycode/cli/files_collector/iac/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
76
76
  cycode/cli/files_collector/iac/tf_content_generator.py,sha256=a65zA0Ejv_LSA5jac2omHck4IKoNS5MX6v6ltF2wo4E,2873
@@ -157,8 +157,8 @@ cycode/cyclient/report_client.py,sha256=h12pz3vWCwDF73BhqFX7iDSxBgQDFwkiGh3hmul2
157
157
  cycode/cyclient/scan_client.py,sha256=nQJyt34Bne8UAQNj9OHSgvoCfI1EJFKNaEeeGPnrKcg,12471
158
158
  cycode/cyclient/scan_config_base.py,sha256=mXsPZGYCtp85rv5GIige40yQZXuRcEKUW-VQJ0vgFzk,1201
159
159
  cycode/logger.py,sha256=xAzpkWLZhixO4egRcYn4HXM9lIfx5wHdpkHxNc5jrX8,2225
160
- cycode-3.4.1.dev6.dist-info/LICENCE,sha256=2Wx4N6mD_4xB7-E3hPkZ3MPhpJy__k_I8MaCSO-PDRo,1068
161
- cycode-3.4.1.dev6.dist-info/METADATA,sha256=FXo6z9CPWM-trJ2odcxc8eLdaXvCEOw5Q_WwyO0zNhM,71912
162
- cycode-3.4.1.dev6.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
163
- cycode-3.4.1.dev6.dist-info/entry_points.txt,sha256=iDcVJM8ByLElVgvBgtYxDjw1kT7O8Mo0LcWZIT5L3Ig,45
164
- cycode-3.4.1.dev6.dist-info/RECORD,,
160
+ cycode-3.4.2.dev1.dist-info/LICENCE,sha256=2Wx4N6mD_4xB7-E3hPkZ3MPhpJy__k_I8MaCSO-PDRo,1068
161
+ cycode-3.4.2.dev1.dist-info/METADATA,sha256=ebfwDPm_9tpFqZEBq3-HebH9uJLqo_l4A_MUYNW13K4,71912
162
+ cycode-3.4.2.dev1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
163
+ cycode-3.4.2.dev1.dist-info/entry_points.txt,sha256=iDcVJM8ByLElVgvBgtYxDjw1kT7O8Mo0LcWZIT5L3Ig,45
164
+ cycode-3.4.2.dev1.dist-info/RECORD,,