Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeurbanski1 committed Aug 16, 2024
1 parent 8201fc5 commit 86d4894
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions checkov/common/checks_infra/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ def __init__(self, checks_dir: str, parser: BaseGraphCheckParser | None = None)
def load_checks(self) -> None:
if not self.checks:
self._load_checks_from_dir(self.checks_dir, False)

# the first time this runs, custom_policies_checks will not have been set yet, so we don't want to prematurely mark
# custom policies as loaded.
# this does mean that for a registry that has no custom policies to load, this condition will never be skipped (but it will also have no effect)
# maybe there is a better way to do it
if not self.custom_policies_loaded and self.custom_policies_checks:
self.checks += self.custom_policies_checks
self.custom_policies_loaded = True
Expand Down

0 comments on commit 86d4894

Please sign in to comment.