Skip to content

Commit

Permalink
change name of cli argument.
Browse files Browse the repository at this point in the history
  • Loading branch information
pyth0n1c committed Sep 30, 2024
1 parent 82e350d commit c457b3d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions contentctl/actions/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,10 @@ def check_detection_metadata(self, config: inspect) -> None:
validation_errors[rule_name] = []
# No detections should be removed from build to build
if rule_name not in current_build_conf.detection_stanzas:
if config.exception_on_removed_detections:
validation_errors[rule_name].append(DetectionMissingError(rule_name=rule_name))
else:
if config.supress_missing_content_exceptions:
print(f"[SUPPRESSED] {DetectionMissingError(rule_name=rule_name).long_message}")
else:
validation_errors[rule_name].append(DetectionMissingError(rule_name=rule_name))
continue
# Pull out the individual stanza for readability
previous_stanza = previous_build_conf.detection_stanzas[rule_name]
Expand Down
10 changes: 6 additions & 4 deletions contentctl/objects/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,14 @@ class inspect(build):
"should be enabled."
)
)
exception_on_removed_detections: bool = Field(
default=True,
supress_missing_content_exceptions: bool = Field(
default=False,
description=(
"Throw an exception during metadata validation if a detection that existed in "
"Suppress exceptions during metadata validation if a detection that existed in "
"the previous build does not exist in this build. This is to ensure that content "
"is not accidentally removed."
"is not accidentally removed. In order to support testing both public and private "
"content, this warning can be suppressed. If it is suppressed, it will still be "
"printed out as a warning."
)
)
enrichments: bool = Field(
Expand Down

0 comments on commit c457b3d

Please sign in to comment.