RM003#
- class src.ansys.pre_commit_hooks.quality_rules.readme.RM003#
Bases:
READMEREADME has a license badge matching project metadata.
Reads the license declared in
[project].licenseofpyproject.tomland looks for a license badge for the same license. The declaration can be a license string, alicense.textvalue, or alicense.filepath whose content is read. MIT, Apache-2.0, BSD-2-Clause and BSD-3-Clause are recognized. Any other license is matched by its declared text.Notes
A missing badge, or a badge for a different license, produces a warning, including when there is no README file.
A warning is also produced when
pyproject.tomlis missing or invalid, or declares no license, because the badge cannot be verified.
Overview#
Return whether the README license badge matches project metadata. |
Import detail#
from src.ansys.pre_commit_hooks.quality_rules.readme import RM003
Method detail#
- static RM003.check(repository_root: pathlib.Path, readme_file: str | None) ansys.pre_commit_hooks.quality_rules.common.RuleCheckResult#
Return whether the README license badge matches project metadata.
- Parameters:
- repository_root
pathlib.Path Repository root directory.
- readme_file
strorNone Name of the detected README file, or
Noneif there is none.
- repository_root
- Returns: