SEC005#

class src.ansys.pre_commit_hooks.quality_rules.security.SEC005#

Bases: Security

Pre-commit repositories pin revisions to commit SHAs.

Overview#

check

Recommend pinning each remote pre-commit repository to a commit SHA.

Import detail#

from src.ansys.pre_commit_hooks.quality_rules.security import SEC005

Method detail#

static SEC005.check(repository_root: pathlib.Path, readme_file: str | None) → ansys.pre_commit_hooks.quality_rules.common.RuleCheckResult#

Recommend pinning each remote pre-commit repository to a commit SHA.

Returns:
bool or str

True when every remote repository rev is a full commit SHA, a recommendation naming the repositories pinned to tags or branches, or an "ERROR: ..." message when the configuration is invalid.