1313from ggshield .cmd .utils .common_decorators import display_beta_warning , exception_wrapper
1414from ggshield .cmd .utils .common_options import directory_argument
1515from ggshield .cmd .utils .context_obj import ContextObj
16+ from ggshield .core import ui
1617from ggshield .core .git_hooks .ci .get_scan_ci_parameters import (
1718 NotAMergeRequestError ,
1819 get_scan_ci_parameters ,
@@ -58,10 +59,7 @@ def scan_ci_cmd(
5859 ci_mode , wd = directory , verbose = config .user_config .verbose
5960 )
6061 if params is None :
61- click .echo (
62- "No commit found in merge request, skipping scan." ,
63- err = True ,
64- )
62+ ui .display_info ("No commit found in merge request, skipping scan." )
6563 return 0
6664
6765 current_commit , reference_commit = params
@@ -78,13 +76,10 @@ def scan_ci_cmd(
7876 augment_unignored_issues (config .user_config , result )
7977 return display_iac_scan_diff_result (ctx , directory , result )
8078 except NotAMergeRequestError :
81- click .echo (
82- (
83- "WARNING: scan ci expects to be run in a merge-request pipeline.\n "
84- "No target branch could be identified, will perform a scan all instead.\n "
85- "This is a fallback behaviour, that will be removed in a future version."
86- ),
87- err = True ,
79+ ui .display_warning (
80+ "scan ci expects to be run in a merge-request pipeline.\n "
81+ "No target branch could be identified, will perform a scan all instead.\n "
82+ "This is a fallback behaviour, that will be removed in a future version."
8883 )
8984 result = iac_scan_all (
9085 ctx , directory , scan_mode = ScanMode .CI_ALL , ci_mode = ci_mode
0 commit comments