Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: swap default behaviour for fail fast #46

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions rocrate_validator/cli/commands/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ def get_single_char(console: Optional[Console] = None, end: str = "\n",
@cli.command("validate")
@click.argument("rocrate-uri", callback=validate_uri, default=".")
@click.option(
'-nff',
'--no-fail-fast',
'-ff',
'--fail-fast',
is_flag=True,
help="Disable fail fast validation mode",
help="Fail fast validation mode",
default=False,
show_default=True
)
Expand Down Expand Up @@ -239,7 +239,7 @@ def validate(ctx,
requirement_severity: str = Severity.REQUIRED.name,
requirement_severity_only: bool = False,
rocrate_uri: Path = ".",
no_fail_fast: bool = False,
fail_fast: bool = False,
no_paging: bool = False,
verbose: bool = False,
output_format: str = "text",
Expand All @@ -264,8 +264,8 @@ def validate(ctx,

logger.debug("disable_inheritance: %s", disable_profile_inheritance)
logger.debug("rocrate_uri: %s", rocrate_uri)
logger.debug("no_fail_fast: %s", no_fail_fast)
logger.debug("fail fast: %s", not no_fail_fast)
logger.debug("fail_fast: %s", fail_fast)
logger.debug("no fail fast: %s", not fail_fast)

if rocrate_uri:
logger.debug("rocrate_path: %s", os.path.abspath(rocrate_uri))
Expand All @@ -280,7 +280,7 @@ def validate(ctx,
"enable_profile_inheritance": not disable_profile_inheritance,
"verbose": verbose,
"rocrate_uri": rocrate_uri,
"abort_on_first": not no_fail_fast
"abort_on_first": fail_fast
}

# Print the application header
Expand Down Expand Up @@ -406,7 +406,7 @@ def validate(ctx,
report_layout.show_validation_details(None, enable_pager=False)

# Interrupt the validation if the fail fast mode is enabled
if no_fail_fast and not is_valid:
if fail_fast and not is_valid:
break

# using ctx.exit seems to raise an Exception that gets caught below,
Expand Down