Security#

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

Bases: abc.ABC

Security rule family.

Base class of the security quality rules. Each rule is a subclass named SEC with a static check method that evaluates one security control of the repository independently.

Overview#

check

Evaluate a security rule.

Import detail#

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

Attribute detail#

Security.family: ClassVar[str] = 'security'#

Method detail#

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

Evaluate a security rule.

Parameters:
repository_rootpathlib.Path

Repository root directory.

readme_filestr or None

Detected README path, unused by this rule family.

Returns:
bool or str

True when the rule passes, False for an error, or a string prefixed with "RECOMMENDATION: ", "WARNING: ", or "ERROR: ".