Skip to content

Commit 0026948

Browse files
committed
feat(cli): ✨ improve parsing of the --skip-checks option
1 parent 80c7fe1 commit 0026948

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

rocrate_validator/cli/commands/validate.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,25 @@ def validate(ctx,
281281
if rocrate_uri:
282282
logger.debug("rocrate_path: %s", os.path.abspath(rocrate_uri))
283283

284+
# Parse the skip_checks option
285+
logger.debug("skip_checks: %s", skip_checks)
286+
# Parse the skip_checks option
287+
skip_checks_list = []
288+
if skip_checks:
289+
try:
290+
for s in skip_checks:
291+
skip_checks_list.extend(_.strip() for _ in s.split(",") if _.strip())
292+
logger.debug("skip_checks_list: %s", skip_checks_list)
293+
except Exception as e:
294+
logger.error("Error parsing skip_checks: %s", e)
295+
if logger.isEnabledFor(logging.DEBUG):
296+
logger.exception("Error parsing skip_checks: %s", e)
297+
raise ValueError(
298+
f"Invalid skip_checks value: {s}. "
299+
"It must be a comma-separated list of Fully Qualified Check IDs."
300+
)
301+
logger.debug("Skip checks: %s", skip_checks_list)
302+
284303
try:
285304
# Validation settings
286305
validation_settings = {
@@ -291,7 +310,7 @@ def validate(ctx,
291310
"enable_profile_inheritance": not disable_profile_inheritance,
292311
"rocrate_uri": rocrate_uri,
293312
"abort_on_first": fail_fast,
294-
"skip_checks": skip_checks
313+
"skip_checks": skip_checks_list
295314
}
296315

297316
# Print the application header

0 commit comments

Comments
 (0)