RM000#

class src.ansys.pre_commit_hooks.quality_rules.readme.RM000#

Bases: README

README file exists.

Requires a README.rst or README.md file in the repository root.

Notes

  • README.rst passes.

  • README.md is accepted with a warning, because README.rst is preferred.

  • A missing README produces an error.

Overview#

check

Return whether the repository has a supported README file.

Import detail#

from src.ansys.pre_commit_hooks.quality_rules.readme import RM000

Method detail#

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

Return whether the repository has a supported README file.

Parameters:
repository_rootpathlib.Path

Repository root directory.

readme_filestr or None

Name of the detected README file, or None if there is none.

Returns:
bool or str

True for README.rst, a "WARNING: ..." message for README.md, and False if no README exists.