diff options
author | Tim Harder <radhermit@gmail.com> | 2020-01-16 04:26:56 -0700 |
---|---|---|
committer | Tim Harder <radhermit@gmail.com> | 2020-01-16 04:26:56 -0700 |
commit | fefc26f89f6b6ef85be28d709ae34bc84edddc46 (patch) | |
tree | 9ad533bbed26961174d4135a74e827c9ffe64754 /doc | |
parent | git: note that --commits generates targets from committed changes (diff) | |
download | pkgcheck-fefc26f89f6b6ef85be28d709ae34bc84edddc46.tar.gz pkgcheck-fefc26f89f6b6ef85be28d709ae34bc84edddc46.tar.bz2 pkgcheck-fefc26f89f6b6ef85be28d709ae34bc84edddc46.zip |
doc: add gentoo repo specific notes for relevant keyword/check output
Diffstat (limited to 'doc')
-rwxr-xr-x | doc/generate/pkgcheck/checks.py | 3 | ||||
-rwxr-xr-x | doc/generate/pkgcheck/keywords.py | 9 |
2 files changed, 9 insertions, 3 deletions
diff --git a/doc/generate/pkgcheck/checks.py b/doc/generate/pkgcheck/checks.py index 5d62ee2d..da671b2a 100755 --- a/doc/generate/pkgcheck/checks.py +++ b/doc/generate/pkgcheck/checks.py @@ -21,6 +21,7 @@ from textwrap import dedent, TextWrapper from snakeoil.strings import pluralism as _pl from pkgcheck import base, const +from pkgcheck.checks import GentooRepoCheck def main(f=sys.stdout, **kwargs): @@ -59,6 +60,8 @@ def main(f=sys.stdout, **kwargs): if explanation: explanation = '\n'.join(dedent(explanation).strip().split('\n')) out('\n' + explanation) + if issubclass(check, GentooRepoCheck): + out(f'\n- Gentoo repo specific') known_results = ', '.join( f'`{r.__name__}`_' for r in sorted(check.known_results, key=attrgetter('__name__'))) diff --git a/doc/generate/pkgcheck/keywords.py b/doc/generate/pkgcheck/keywords.py index 816ec604..03b66890 100755 --- a/doc/generate/pkgcheck/keywords.py +++ b/doc/generate/pkgcheck/keywords.py @@ -16,6 +16,7 @@ from textwrap import dedent from snakeoil.strings import pluralism as _pl from pkgcheck import base, const +from pkgcheck.checks import GentooRepoCheck def main(f=sys.stdout, **kwargs): @@ -35,7 +36,7 @@ def main(f=sys.stdout, **kwargs): related_checks = defaultdict(set) for check in const.CHECKS.values(): for keyword in check.known_results: - related_checks[keyword].add(check.__name__) + related_checks[keyword].add(check) for scope in base.scopes.values(): _rst_header('-', scope.desc.capitalize() + ' scope') @@ -57,9 +58,11 @@ def main(f=sys.stdout, **kwargs): if explanation: explanation = '\n'.join(dedent(explanation).strip().split('\n')) out('\n' + explanation) - checks = ', '.join( - f'`{c}`_' for c in sorted(related_checks[keyword])) + if all(issubclass(x, GentooRepoCheck) for x in related_checks[keyword]): + out(f'- Gentoo repo specific') out('\n' + f'- level: {keyword.level}') + checks = ', '.join(sorted( + f'`{c.__name__}`_' for c in related_checks[keyword])) out(f'- related check{_pl(related_checks[keyword])}: {checks}') |