cycode 3.24.2.dev1__tar.gz → 3.24.3.dev1__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 (223) hide show
  1. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/PKG-INFO +12 -13
  2. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/README.md +11 -12
  3. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/__init__.py +1 -1
  4. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/scan/pre_push/pre_push_command.py +27 -10
  5. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/scan/scan_result.py +13 -2
  6. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/consts.py +10 -0
  7. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/exceptions/custom_exceptions.py +5 -0
  8. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/exceptions/handle_scan_errors.py +6 -0
  9. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/commit_range_documents.py +34 -3
  10. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/printers/utils/code_snippet_syntax.py +2 -1
  11. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/pyproject.toml +1 -1
  12. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/LICENCE +0 -0
  13. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/__main__.py +0 -0
  14. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/__init__.py +0 -0
  15. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/app.py +0 -0
  16. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/__init__.py +0 -0
  17. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/activation_manager.py +0 -0
  18. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/__init__.py +0 -0
  19. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/command_utils.py +0 -0
  20. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/consts.py +0 -0
  21. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/hooks_manager.py +0 -0
  22. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/ides/__init__.py +0 -0
  23. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/ides/_plugin_utils.py +0 -0
  24. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/ides/_skill_utils.py +0 -0
  25. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/ides/base.py +0 -0
  26. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/ides/claude_code.py +0 -0
  27. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/ides/codex.py +0 -0
  28. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/ides/copilot.py +0 -0
  29. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/ides/cursor.py +0 -0
  30. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/install_command.py +0 -0
  31. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/scan/__init__.py +0 -0
  32. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/scan/consts.py +0 -0
  33. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/scan/detach.py +0 -0
  34. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/scan/guardrail_config.py +0 -0
  35. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/scan/handlers.py +0 -0
  36. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/scan/payload.py +0 -0
  37. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/scan/policy.py +0 -0
  38. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/scan/scan_command.py +0 -0
  39. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/scan/types.py +0 -0
  40. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/scan/utils.py +0 -0
  41. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/session_start_command.py +0 -0
  42. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/status_command.py +0 -0
  43. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_guardrails/uninstall_command.py +0 -0
  44. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_remediation/__init__.py +0 -0
  45. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_remediation/ai_remediation_command.py +0 -0
  46. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_remediation/apply_fix.py +0 -0
  47. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ai_remediation/print_remediation.py +0 -0
  48. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/api/__init__.py +0 -0
  49. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/api/api_command.py +0 -0
  50. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/api/openapi_spec.py +0 -0
  51. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/auth/__init__.py +0 -0
  52. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/auth/auth_command.py +0 -0
  53. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/auth/auth_common.py +0 -0
  54. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/auth/auth_manager.py +0 -0
  55. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/auth/models.py +0 -0
  56. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/configure/__init__.py +0 -0
  57. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/configure/configure_command.py +0 -0
  58. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/configure/consts.py +0 -0
  59. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/configure/messages.py +0 -0
  60. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/configure/prompts.py +0 -0
  61. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ignore/__init__.py +0 -0
  62. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/ignore/ignore_command.py +0 -0
  63. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/mcp/__init__.py +0 -0
  64. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/mcp/mcp_command.py +0 -0
  65. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/report/__init__.py +0 -0
  66. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/report/report_command.py +0 -0
  67. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/report/sbom/__init__.py +0 -0
  68. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/report/sbom/common.py +0 -0
  69. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/report/sbom/path/__init__.py +0 -0
  70. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/report/sbom/path/path_command.py +0 -0
  71. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/report/sbom/repository_url/__init__.py +0 -0
  72. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/report/sbom/repository_url/repository_url_command.py +0 -0
  73. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/report/sbom/sbom_command.py +0 -0
  74. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/report/sbom/sbom_report_file.py +0 -0
  75. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/report_import/__init__.py +0 -0
  76. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/report_import/report_import_command.py +0 -0
  77. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/report_import/sbom/__init__.py +0 -0
  78. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/report_import/sbom/sbom_command.py +0 -0
  79. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/sca_options.py +0 -0
  80. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/scan/__init__.py +0 -0
  81. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/scan/aggregation_report.py +0 -0
  82. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/scan/code_scanner.py +0 -0
  83. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/scan/commit_history/__init__.py +0 -0
  84. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/scan/commit_history/commit_history_command.py +0 -0
  85. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/scan/commit_range_scanner.py +0 -0
  86. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/scan/detection_excluder.py +0 -0
  87. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/scan/path/__init__.py +0 -0
  88. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/scan/path/path_command.py +0 -0
  89. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/scan/pre_commit/__init__.py +0 -0
  90. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/scan/pre_commit/pre_commit_command.py +0 -0
  91. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/scan/pre_push/__init__.py +0 -0
  92. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/scan/pre_receive/__init__.py +0 -0
  93. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/scan/pre_receive/pre_receive_command.py +0 -0
  94. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/scan/remote_url_resolver.py +0 -0
  95. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/scan/repository/__init__.py +0 -0
  96. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/scan/repository/repository_command.py +0 -0
  97. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/scan/scan_ci/__init__.py +0 -0
  98. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/scan/scan_ci/ci_integrations.py +0 -0
  99. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/scan/scan_ci/scan_ci_command.py +0 -0
  100. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/scan/scan_command.py +0 -0
  101. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/scan/scan_parameters.py +0 -0
  102. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/status/__init__.py +0 -0
  103. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/status/get_cli_status.py +0 -0
  104. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/status/models.py +0 -0
  105. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/status/status_command.py +0 -0
  106. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/apps/status/version_command.py +0 -0
  107. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/cli_types.py +0 -0
  108. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/config.py +0 -0
  109. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/console.py +0 -0
  110. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/exceptions/__init__.py +0 -0
  111. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/exceptions/handle_ai_remediation_errors.py +0 -0
  112. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/exceptions/handle_auth_errors.py +0 -0
  113. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/exceptions/handle_errors.py +0 -0
  114. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/exceptions/handle_report_sbom_errors.py +0 -0
  115. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/__init__.py +0 -0
  116. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/documents_walk_ignore.py +0 -0
  117. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/file_excluder.py +0 -0
  118. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/iac/__init__.py +0 -0
  119. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/iac/tf_content_generator.py +0 -0
  120. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/models/__init__.py +0 -0
  121. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/models/in_memory_zip.py +0 -0
  122. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/path_documents.py +0 -0
  123. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/repository_documents.py +0 -0
  124. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/__init__.py +0 -0
  125. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/base_restore_dependencies.py +0 -0
  126. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/go/__init__.py +0 -0
  127. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/go/restore_go_dependencies.py +0 -0
  128. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/maven/__init__.py +0 -0
  129. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/maven/restore_gradle_dependencies.py +0 -0
  130. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/maven/restore_maven_dependencies.py +0 -0
  131. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/npm/__init__.py +0 -0
  132. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/npm/restore_bun_dependencies.py +0 -0
  133. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/npm/restore_deno_dependencies.py +0 -0
  134. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/npm/restore_npm_dependencies.py +0 -0
  135. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/npm/restore_pnpm_dependencies.py +0 -0
  136. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/npm/restore_yarn_dependencies.py +0 -0
  137. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/nuget/__init__.py +0 -0
  138. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/nuget/restore_nuget_dependencies.py +0 -0
  139. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/php/__init__.py +0 -0
  140. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/php/restore_composer_dependencies.py +0 -0
  141. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/python/__init__.py +0 -0
  142. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/python/restore_pip_dependencies.py +0 -0
  143. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/python/restore_pipenv_dependencies.py +0 -0
  144. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/python/restore_poetry_dependencies.py +0 -0
  145. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/python/restore_uv_dependencies.py +0 -0
  146. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/ruby/__init__.py +0 -0
  147. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/ruby/restore_ruby_dependencies.py +0 -0
  148. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/sbt/__init__.py +0 -0
  149. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/sbt/restore_sbt_dependencies.py +0 -0
  150. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/sca/sca_file_collector.py +0 -0
  151. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/walk_ignore.py +0 -0
  152. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/files_collector/zip_documents.py +0 -0
  153. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/logger.py +0 -0
  154. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/main.py +0 -0
  155. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/models.py +0 -0
  156. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/printers/__init__.py +0 -0
  157. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/printers/console_printer.py +0 -0
  158. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/printers/json_printer.py +0 -0
  159. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/printers/printer_base.py +0 -0
  160. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/printers/rich_printer.py +0 -0
  161. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/printers/tables/__init__.py +0 -0
  162. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/printers/tables/sca_table_printer.py +0 -0
  163. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/printers/tables/table.py +0 -0
  164. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/printers/tables/table_models.py +0 -0
  165. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/printers/tables/table_printer.py +0 -0
  166. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/printers/tables/table_printer_base.py +0 -0
  167. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/printers/text_printer.py +0 -0
  168. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/printers/utils/__init__.py +0 -0
  169. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/printers/utils/detection_data.py +0 -0
  170. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/printers/utils/detection_ordering/__init__.py +0 -0
  171. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/printers/utils/detection_ordering/common_ordering.py +0 -0
  172. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/printers/utils/detection_ordering/sca_ordering.py +0 -0
  173. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/printers/utils/rich_helpers.py +0 -0
  174. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/printers/utils/sca_ossf.py +0 -0
  175. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/printers/utils/sca_policy_details.py +0 -0
  176. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/user_settings/__init__.py +0 -0
  177. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/user_settings/base_file_manager.py +0 -0
  178. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/user_settings/config_file_manager.py +0 -0
  179. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/user_settings/configuration_manager.py +0 -0
  180. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/user_settings/credentials_manager.py +0 -0
  181. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/user_settings/jwt_creator.py +0 -0
  182. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/utils/__init__.py +0 -0
  183. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/utils/binary_utils.py +0 -0
  184. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/utils/enum_utils.py +0 -0
  185. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/utils/get_api_client.py +0 -0
  186. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/utils/git_proxy.py +0 -0
  187. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/utils/host_info.py +0 -0
  188. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/utils/ignore_utils.py +0 -0
  189. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/utils/jwt_utils.py +0 -0
  190. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/utils/path_utils.py +0 -0
  191. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/utils/progress_bar.py +0 -0
  192. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/utils/scan_batch.py +0 -0
  193. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/utils/scan_utils.py +0 -0
  194. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/utils/shell_executor.py +0 -0
  195. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/utils/string_utils.py +0 -0
  196. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/utils/task_timer.py +0 -0
  197. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/utils/trust_store.py +0 -0
  198. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/utils/url_utils.py +0 -0
  199. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/utils/version_checker.py +0 -0
  200. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cli/utils/yaml_utils.py +0 -0
  201. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/config.py +0 -0
  202. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cyclient/__init__.py +0 -0
  203. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cyclient/ai_security_manager_client.py +0 -0
  204. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cyclient/ai_security_manager_service_config.py +0 -0
  205. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cyclient/auth_client.py +0 -0
  206. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cyclient/base_token_auth_client.py +0 -0
  207. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cyclient/cli_activation_client.py +0 -0
  208. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cyclient/client_creator.py +0 -0
  209. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cyclient/config.py +0 -0
  210. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cyclient/config_dev.py +0 -0
  211. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cyclient/cycode_client.py +0 -0
  212. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cyclient/cycode_client_base.py +0 -0
  213. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cyclient/cycode_dev_based_client.py +0 -0
  214. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cyclient/cycode_oidc_based_client.py +0 -0
  215. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cyclient/cycode_token_based_client.py +0 -0
  216. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cyclient/headers.py +0 -0
  217. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cyclient/import_sbom_client.py +0 -0
  218. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cyclient/logger.py +0 -0
  219. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cyclient/models.py +0 -0
  220. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cyclient/report_client.py +0 -0
  221. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cyclient/scan_client.py +0 -0
  222. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/cyclient/scan_config_base.py +0 -0
  223. {cycode-3.24.2.dev1 → cycode-3.24.3.dev1}/cycode/logger.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cycode
3
- Version: 3.24.2.dev1
3
+ Version: 3.24.3.dev1
4
4
  Summary: Boost security in your dev lifecycle via SAST, SCA, Secrets & IaC scanning.
5
5
  License-Expression: MIT
6
6
  License-File: LICENCE
@@ -304,7 +304,7 @@ Perform the following steps to install the pre-commit hook:
304
304
  ```yaml
305
305
  repos:
306
306
  - repo: https://github.com/cycodehq/cycode-cli
307
- rev: v3.5.0
307
+ rev: v3.25.0
308
308
  hooks:
309
309
  - id: cycode
310
310
  stages: [pre-commit]
@@ -315,7 +315,7 @@ Perform the following steps to install the pre-commit hook:
315
315
  ```yaml
316
316
  repos:
317
317
  - repo: https://github.com/cycodehq/cycode-cli
318
- rev: v3.5.0
318
+ rev: v3.25.0
319
319
  hooks:
320
320
  - id: cycode
321
321
  stages: [pre-commit]
@@ -354,7 +354,7 @@ To install the pre-push hook in addition to or instead of the pre-commit hook:
354
354
  ```yaml
355
355
  repos:
356
356
  - repo: https://github.com/cycodehq/cycode-cli
357
- rev: v3.5.0
357
+ rev: v3.25.0
358
358
  hooks:
359
359
  - id: cycode-pre-push
360
360
  stages: [pre-push]
@@ -1155,7 +1155,7 @@ To set up the pre-push hook using the pre-commit framework:
1155
1155
  ```yaml
1156
1156
  repos:
1157
1157
  - repo: https://github.com/cycodehq/cycode-cli
1158
- rev: v3.5.0
1158
+ rev: v3.25.0
1159
1159
  hooks:
1160
1160
  - id: cycode-pre-push
1161
1161
  stages: [pre-push]
@@ -1166,7 +1166,7 @@ To set up the pre-push hook using the pre-commit framework:
1166
1166
  ```yaml
1167
1167
  repos:
1168
1168
  - repo: https://github.com/cycodehq/cycode-cli
1169
- rev: v3.5.0
1169
+ rev: v3.25.0
1170
1170
  hooks:
1171
1171
  - id: cycode-pre-push # Secrets scan
1172
1172
  stages: [pre-push]
@@ -1192,16 +1192,15 @@ To set up the pre-push hook using the pre-commit framework:
1192
1192
 
1193
1193
  #### How Pre-Push Scanning Works
1194
1194
 
1195
- The pre-push hook:
1196
- - Receives information about what commits are being pushed
1197
- - Calculates the appropriate commit range to scan
1198
- - For new branches: scans all commits from the merge base with the default branch
1199
- - For existing branches: scans only the new commits since the last push
1200
- - Runs the same comprehensive scanning as other Cycode scan modes
1195
+ The hook scans every commit being pushed, one commit at a time, so a secret added in one commit and removed in a later one is still caught. When installed through the pre-commit framework, the pushed range is taken from the framework: new commits since the remote branch for existing branches, and the commits not yet on the remote for new branches (all commits when pushing to an empty remote). When run from a hand-written `.git/hooks/pre-push`, the range is read from git's hook input, and new branches are scanned from their merge base with the default branch (see below).
1196
+
1197
+ Pushes with nothing to scan, such as tags, branch deletions, and up-to-date pushes, pass without a scan. If the hook cannot determine what is being pushed, it fails and blocks the push instead of passing silently.
1198
+
1199
+ The Cycode pre-push hooks set `always_run: true` and `pass_filenames: false`, because the scan covers the pushed commits rather than a list of files. Without `always_run`, the pre-commit framework skips the hook when the pushed commits add up to no changed files, such as a secret added in one commit and deleted in the next. Without `pass_filenames: false`, the framework passes changed file names the scan does not use, and on large pushes it splits them into batches and runs the full scan once per batch. If you define the hook yourself (for example, as a `repo: local` hook), set both options.
1201
1200
 
1202
1201
  #### Smart Default Branch Detection
1203
1202
 
1204
- The pre-push hook intelligently detects the default branch for merge base calculation using this priority order:
1203
+ When run from a hand-written hook, the pre-push scan detects the default branch for merge base calculation using this priority order:
1205
1204
 
1206
1205
  1. **Environment Variable**: `CYCODE_DEFAULT_BRANCH` - allows manual override
1207
1206
  2. **Git Remote HEAD**: Uses `git symbolic-ref refs/remotes/origin/HEAD` to detect the actual remote default branch
@@ -258,7 +258,7 @@ Perform the following steps to install the pre-commit hook:
258
258
  ```yaml
259
259
  repos:
260
260
  - repo: https://github.com/cycodehq/cycode-cli
261
- rev: v3.5.0
261
+ rev: v3.25.0
262
262
  hooks:
263
263
  - id: cycode
264
264
  stages: [pre-commit]
@@ -269,7 +269,7 @@ Perform the following steps to install the pre-commit hook:
269
269
  ```yaml
270
270
  repos:
271
271
  - repo: https://github.com/cycodehq/cycode-cli
272
- rev: v3.5.0
272
+ rev: v3.25.0
273
273
  hooks:
274
274
  - id: cycode
275
275
  stages: [pre-commit]
@@ -308,7 +308,7 @@ To install the pre-push hook in addition to or instead of the pre-commit hook:
308
308
  ```yaml
309
309
  repos:
310
310
  - repo: https://github.com/cycodehq/cycode-cli
311
- rev: v3.5.0
311
+ rev: v3.25.0
312
312
  hooks:
313
313
  - id: cycode-pre-push
314
314
  stages: [pre-push]
@@ -1109,7 +1109,7 @@ To set up the pre-push hook using the pre-commit framework:
1109
1109
  ```yaml
1110
1110
  repos:
1111
1111
  - repo: https://github.com/cycodehq/cycode-cli
1112
- rev: v3.5.0
1112
+ rev: v3.25.0
1113
1113
  hooks:
1114
1114
  - id: cycode-pre-push
1115
1115
  stages: [pre-push]
@@ -1120,7 +1120,7 @@ To set up the pre-push hook using the pre-commit framework:
1120
1120
  ```yaml
1121
1121
  repos:
1122
1122
  - repo: https://github.com/cycodehq/cycode-cli
1123
- rev: v3.5.0
1123
+ rev: v3.25.0
1124
1124
  hooks:
1125
1125
  - id: cycode-pre-push # Secrets scan
1126
1126
  stages: [pre-push]
@@ -1146,16 +1146,15 @@ To set up the pre-push hook using the pre-commit framework:
1146
1146
 
1147
1147
  #### How Pre-Push Scanning Works
1148
1148
 
1149
- The pre-push hook:
1150
- - Receives information about what commits are being pushed
1151
- - Calculates the appropriate commit range to scan
1152
- - For new branches: scans all commits from the merge base with the default branch
1153
- - For existing branches: scans only the new commits since the last push
1154
- - Runs the same comprehensive scanning as other Cycode scan modes
1149
+ The hook scans every commit being pushed, one commit at a time, so a secret added in one commit and removed in a later one is still caught. When installed through the pre-commit framework, the pushed range is taken from the framework: new commits since the remote branch for existing branches, and the commits not yet on the remote for new branches (all commits when pushing to an empty remote). When run from a hand-written `.git/hooks/pre-push`, the range is read from git's hook input, and new branches are scanned from their merge base with the default branch (see below).
1150
+
1151
+ Pushes with nothing to scan, such as tags, branch deletions, and up-to-date pushes, pass without a scan. If the hook cannot determine what is being pushed, it fails and blocks the push instead of passing silently.
1152
+
1153
+ The Cycode pre-push hooks set `always_run: true` and `pass_filenames: false`, because the scan covers the pushed commits rather than a list of files. Without `always_run`, the pre-commit framework skips the hook when the pushed commits add up to no changed files, such as a secret added in one commit and deleted in the next. Without `pass_filenames: false`, the framework passes changed file names the scan does not use, and on large pushes it splits them into batches and runs the full scan once per batch. If you define the hook yourself (for example, as a `repo: local` hook), set both options.
1155
1154
 
1156
1155
  #### Smart Default Branch Detection
1157
1156
 
1158
- The pre-push hook intelligently detects the default branch for merge base calculation using this priority order:
1157
+ When run from a hand-written hook, the pre-push scan detects the default branch for merge base calculation using this priority order:
1159
1158
 
1160
1159
  1. **Environment Variable**: `CYCODE_DEFAULT_BRANCH` - allows manual override
1161
1160
  2. **Git Remote HEAD**: Uses `git symbolic-ref refs/remotes/origin/HEAD` to detect the actual remote default branch
@@ -5,4 +5,4 @@ import time as _time
5
5
  # end-to-end scan duration from the moment the user actually triggered it.
6
6
  _BOOT_WALL: float = _time.time()
7
7
 
8
- __version__ = '3.24.2.dev1' # DON'T TOUCH. Placeholder. Will be filled automatically on poetry build from Git Tag
8
+ __version__ = '3.24.3.dev1' # DON'T TOUCH. Placeholder. Will be filled automatically on poetry build from Git Tag
@@ -12,9 +12,12 @@ from cycode.cli.apps.scan.commit_range_scanner import (
12
12
  )
13
13
  from cycode.cli.config import configuration_manager
14
14
  from cycode.cli.console import console
15
+ from cycode.cli.exceptions.custom_exceptions import PrePushInputNotFoundError
15
16
  from cycode.cli.exceptions.handle_scan_errors import handle_scan_exception
16
17
  from cycode.cli.files_collector.commit_range_documents import (
17
18
  calculate_pre_push_commit_range,
19
+ get_pre_commit_framework_push_range,
20
+ is_invoked_by_pre_commit_framework,
18
21
  parse_pre_push_input,
19
22
  )
20
23
  from cycode.cli.logger import logger
@@ -43,17 +46,8 @@ def pre_push_command(
43
46
  command_scan_type = ctx.info_name
44
47
  timeout = configuration_manager.get_pre_push_command_timeout(command_scan_type)
45
48
  with TimeoutAfter(timeout):
46
- push_update_details = parse_pre_push_input()
47
- if not push_update_details:
48
- logger.info('No pre-push input found, nothing to scan')
49
- return
50
-
51
- commit_range = calculate_pre_push_commit_range(push_update_details)
49
+ commit_range = _get_pre_push_commit_range()
52
50
  if not commit_range:
53
- logger.info(
54
- 'No new commits found for pushed branch, %s',
55
- {'push_update_details': push_update_details},
56
- )
57
51
  return
58
52
 
59
53
  scan_commit_range(
@@ -67,3 +61,26 @@ def pre_push_command(
67
61
  console.print(consts.PRE_RECEIVE_AND_PUSH_REMEDIATION_MESSAGE)
68
62
  except Exception as e:
69
63
  handle_scan_exception(ctx, e)
64
+
65
+
66
+ def _get_pre_push_commit_range() -> Optional[str]:
67
+ commit_range = get_pre_commit_framework_push_range()
68
+ if commit_range:
69
+ logger.debug('Using push details from the pre-commit framework, %s', {'commit_range': commit_range})
70
+ return commit_range
71
+
72
+ if is_invoked_by_pre_commit_framework():
73
+ # the framework consumed git's stdin but did not tell us what is being pushed
74
+ raise PrePushInputNotFoundError
75
+
76
+ push_update_details = parse_pre_push_input()
77
+ if not push_update_details:
78
+ # git runs the hook with empty input when everything is up-to-date
79
+ logger.info('No pre-push input found, nothing to scan')
80
+ return None
81
+
82
+ commit_range = calculate_pre_push_commit_range(push_update_details)
83
+ if not commit_range:
84
+ logger.info('No new commits found for pushed branch, %s', {'push_update_details': push_update_details})
85
+
86
+ return commit_range
@@ -7,7 +7,7 @@ from cycode.cli import consts
7
7
  from cycode.cli.apps.scan.aggregation_report import try_get_aggregation_report_url_if_needed
8
8
  from cycode.cli.apps.scan.detection_excluder import exclude_irrelevant_document_detections
9
9
  from cycode.cli.models import Document, DocumentDetections, LocalScanResult
10
- from cycode.cli.utils.path_utils import get_path_by_os, normalize_file_path
10
+ from cycode.cli.utils.path_utils import concat_unique_id, get_path_by_os, normalize_file_path
11
11
  from cycode.cyclient.models import (
12
12
  Detection,
13
13
  DetectionSchema,
@@ -28,8 +28,15 @@ logger = get_logger('Scan Results')
28
28
  def _get_document_by_file_name(
29
29
  documents: list[Document], file_name: str, unique_id: Optional[str] = None
30
30
  ) -> Optional[Document]:
31
+ normalized_file_name = normalize_file_path(file_name)
31
32
  for document in documents:
32
- if normalize_file_path(document.path) == normalize_file_path(file_name) and document.unique_id == unique_id:
33
+ if normalize_file_path(document.path) == normalized_file_name and document.unique_id == unique_id:
34
+ return document
35
+
36
+ if (
37
+ document.unique_id
38
+ and normalize_file_path(concat_unique_id(document.path, document.unique_id)) == normalized_file_name
39
+ ):
33
40
  return document
34
41
 
35
42
  return None
@@ -50,6 +57,10 @@ def _get_document_detections(
50
57
  )
51
58
 
52
59
  document = _get_document_by_file_name(documents_to_scan, file_name, commit_id)
60
+ if document is None:
61
+ logger.debug('Failed to find the document of the violated file, %s', {'file_name': file_name})
62
+ document = Document(file_name, '', unique_id=commit_id)
63
+
53
64
  document_detections.append(DocumentDetections(document=document, detections=detections_per_file.detections))
54
65
 
55
66
  return document_detections
@@ -6,6 +6,8 @@ PRE_COMMIT_COMMAND_SCAN_TYPE = 'pre-commit'
6
6
  PRE_COMMIT_COMMAND_SCAN_TYPE_OLD = 'pre_commit'
7
7
  PRE_RECEIVE_COMMAND_SCAN_TYPE = 'pre-receive'
8
8
  PRE_RECEIVE_COMMAND_SCAN_TYPE_OLD = 'pre_receive'
9
+ PRE_PUSH_COMMAND_SCAN_TYPE = 'pre-push'
10
+ PRE_PUSH_COMMAND_SCAN_TYPE_OLD = 'pre_push'
9
11
  COMMIT_HISTORY_COMMAND_SCAN_TYPE = 'commit-history'
10
12
  COMMIT_HISTORY_COMMAND_SCAN_TYPE_OLD = 'commit_history'
11
13
 
@@ -193,6 +195,8 @@ COMMIT_RANGE_BASED_COMMAND_SCAN_TYPES = [
193
195
  PRE_COMMIT_COMMAND_SCAN_TYPE_OLD,
194
196
  PRE_RECEIVE_COMMAND_SCAN_TYPE,
195
197
  PRE_RECEIVE_COMMAND_SCAN_TYPE_OLD,
198
+ PRE_PUSH_COMMAND_SCAN_TYPE,
199
+ PRE_PUSH_COMMAND_SCAN_TYPE_OLD,
196
200
  COMMIT_HISTORY_COMMAND_SCAN_TYPE,
197
201
  COMMIT_HISTORY_COMMAND_SCAN_TYPE_OLD,
198
202
  ]
@@ -311,6 +315,12 @@ EMPTY_COMMIT_SHA = '0000000000000000000000000000000000000000'
311
315
  GIT_PUSH_OPTION_COUNT_ENV_VAR_NAME = 'GIT_PUSH_OPTION_COUNT'
312
316
  GIT_PUSH_OPTION_ENV_VAR_PREFIX = 'GIT_PUSH_OPTION_'
313
317
 
318
+ # the pre-commit framework consumes git's pre-push stdin and exposes the push details via env vars instead
319
+ PRE_COMMIT_FRAMEWORK_ENV_VAR_NAME = 'PRE_COMMIT'
320
+ PRE_COMMIT_FROM_REF_ENV_VAR_NAME = 'PRE_COMMIT_FROM_REF'
321
+ PRE_COMMIT_TO_REF_ENV_VAR_NAME = 'PRE_COMMIT_TO_REF'
322
+ PRE_COMMIT_REMOTE_BRANCH_ENV_VAR_NAME = 'PRE_COMMIT_REMOTE_BRANCH'
323
+
314
324
  SKIP_SCAN_FLAG = 'skip-cycode-scan'
315
325
  VERBOSE_SCAN_FLAG = 'verbose'
316
326
 
@@ -80,6 +80,11 @@ class FileCollectionError(CycodeError):
80
80
  return self.error_message
81
81
 
82
82
 
83
+ class PrePushInputNotFoundError(CycodeError):
84
+ def __str__(self) -> str:
85
+ return 'Neither git pre-push input nor pre-commit framework push details were found'
86
+
87
+
83
88
  class AuthProcessError(CycodeError):
84
89
  def __init__(self, error_message: str) -> None:
85
90
  self.error_message = error_message
@@ -40,6 +40,12 @@ def handle_scan_exception(ctx: typer.Context, err: Exception, *, return_exceptio
40
40
  message='File collection failed. '
41
41
  'Use --no-restore to skip dependency restoration, or fix the underlying issue.',
42
42
  ),
43
+ custom_exceptions.PrePushInputNotFoundError: CliError(
44
+ soft_fail=False,
45
+ code='pre_push_input_not_found',
46
+ message='Could not determine which commits are being pushed, so nothing was scanned. '
47
+ 'Run this command from a git pre-push hook',
48
+ ),
43
49
  custom_exceptions.TfplanKeyError: CliError(
44
50
  soft_fail=True,
45
51
  code='key_error',
@@ -85,7 +85,11 @@ def collect_commit_range_diff_documents(
85
85
 
86
86
  repo = git_proxy.get_repo(path)
87
87
 
88
- normalized_commit_range = normalize_commit_range(commit_range, path)
88
+ if commit_range == consts.COMMIT_RANGE_ALL_COMMITS:
89
+ # everything reachable from HEAD, including the root commit
90
+ normalized_commit_range = consts.GIT_HEAD_COMMIT_REV
91
+ else:
92
+ normalized_commit_range = normalize_commit_range(commit_range, path)
89
93
 
90
94
  total_commits_count = int(repo.git.rev_list('--count', normalized_commit_range))
91
95
  logger.debug(
@@ -104,8 +108,10 @@ def collect_commit_range_diff_documents(
104
108
 
105
109
  commit_id = commit.hexsha
106
110
  commit_ids_to_scan.append(commit_id)
107
- parent = commit.parents[0] if commit.parents else git_proxy.get_null_tree()
108
- diff_index = commit.diff(parent, create_patch=True, R=True)
111
+ if commit.parents:
112
+ diff_index = commit.diff(commit.parents[0], create_patch=True, R=True)
113
+ else:
114
+ diff_index = commit.diff(git_proxy.get_null_tree(), create_patch=True)
109
115
  for diff in diff_index:
110
116
  commit_documents_to_scan.append(
111
117
  Document(
@@ -264,6 +270,31 @@ def parse_pre_push_input() -> Optional[str]:
264
270
  return pre_push_input.splitlines()[0]
265
271
 
266
272
 
273
+ def is_invoked_by_pre_commit_framework() -> bool:
274
+ return os.getenv(consts.PRE_COMMIT_FRAMEWORK_ENV_VAR_NAME) == '1'
275
+
276
+
277
+ def get_pre_commit_framework_push_range() -> Optional[str]:
278
+ """Get the commit range to scan when invoked as a pre-push hook by the pre-commit framework.
279
+
280
+ The pre-commit framework reads git's pre-push stdin itself and never forwards it to hooks.
281
+ Instead, it exposes the already resolved push details via environment variables.
282
+
283
+ Returns:
284
+ Commit range string for scanning, or None if not invoked by the pre-commit framework
285
+ """
286
+ from_ref = os.getenv(consts.PRE_COMMIT_FROM_REF_ENV_VAR_NAME)
287
+ to_ref = os.getenv(consts.PRE_COMMIT_TO_REF_ENV_VAR_NAME)
288
+ if from_ref and to_ref:
289
+ return f'{from_ref}..{to_ref}'
290
+
291
+ # the framework omits the refs when the pushed history includes the root commit
292
+ if os.getenv(consts.PRE_COMMIT_REMOTE_BRANCH_ENV_VAR_NAME):
293
+ return consts.COMMIT_RANGE_ALL_COMMITS
294
+
295
+ return None
296
+
297
+
267
298
  def _read_hook_input_from_stdin() -> str:
268
299
  """Read input from stdin when called from a hook.
269
300
 
@@ -89,7 +89,8 @@ def _get_code_snippet_syntax_from_git_diff(
89
89
  detection_position = detection_details.get('start_position', -1)
90
90
  violation_length = detection_details.get('length', -1)
91
91
 
92
- line_content = document.content.splitlines()[detection_line]
92
+ document_content_lines = document.content.splitlines()
93
+ line_content = document_content_lines[detection_line] if 0 <= detection_line < len(document_content_lines) else ''
93
94
  detection_position_in_line = get_position_in_line(document.content, detection_position)
94
95
  if scan_type == consts.SECRET_SCAN_TYPE and obfuscate:
95
96
  violation = line_content[detection_position_in_line : detection_position_in_line + violation_length]
@@ -21,7 +21,7 @@ classifiers = [
21
21
  "Programming Language :: Python :: 3.14",
22
22
  ]
23
23
  dynamic = ["dependencies"]
24
- version = "3.24.2.dev1"
24
+ version = "3.24.3.dev1"
25
25
 
26
26
  [project.scripts]
27
27
  cycode = "cycode.cli.app:app"
File without changes