ProjectMetadata#

class src.ansys.pre_commit_hooks.quality_rules.project_metadata.ProjectMetadata#

Bases: abc.ABC

Project metadata rule family.

Base class of the project metadata quality rules. Each rule is a subclass named PM with a static check method that receives the repository root and the name of the detected README file.

Overview#

check

Evaluate a project metadata rule.

Import detail#

from src.ansys.pre_commit_hooks.quality_rules.project_metadata import ProjectMetadata

Attribute detail#

ProjectMetadata.family: ClassVar[str] = 'project_metadata'#

Method detail#

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

Evaluate a project metadata rule.

Parameters:
repository_rootpathlib.Path

Repository root directory.

readme_filestr or None

Detected README path, or None when no supported README exists.

Returns:
bool or str

Raw rule result consumed by the quality-report runner.