RM002#

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

Bases: README

README has a PyPI badge.

Looks for a PyPI badge image: an img.shields.io PyPI badge, a pypi.org/project badge link, or a badge.fury.io/py badge.

Notes

  • A missing badge produces a warning, including when there is no README file.

Overview#

check

Return whether the README contains a PyPI badge.

Import detail#

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

Method detail#

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

Return whether the README contains a PyPI badge.

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 if the badge is found, otherwise a "WARNING: ..." message.