pkgcheck.checks.git module

Various git-related checks.

class pkgcheck.checks.git.BadCommitSummary(error, summary, **kwargs)[source]

Bases: CommitResult, Style

Local package commit with poorly formatted or unmatching commit summary.

Git commit messages for packages should be formatted in the standardized fashion described in the devmanual [1]. Specifically, a ${CATEGORY}/${PN}: or ${CATEGORY}/${P}: prefix should be used in the summary relating to the modified package.

property desc

Result description.

name = 'BadCommitSummary'
class pkgcheck.checks.git.DirectNoMaintainer(pkg, **kwargs)[source]

Bases: PackageResult, Error

Directly added, new package with no specified maintainer.

property desc

Result description.

name = 'DirectNoMaintainer'
class pkgcheck.checks.git.DirectStableKeywords(keywords, **kwargs)[source]

Bases: VersionResult, Error

Newly committed ebuild with stable keywords.

property desc

Result description.

name = 'DirectStableKeywords'
class pkgcheck.checks.git.DroppedStableKeywords(keywords, commit, **kwargs)[source]

Bases: _DroppedKeywords, Error

Stable keywords dropped from package.

name = 'DroppedStableKeywords'
class pkgcheck.checks.git.DroppedUnstableKeywords(keywords, commit, **kwargs)[source]

Bases: _DroppedKeywords, Error

Unstable keywords dropped from package.

name = 'DroppedUnstableKeywords'
class pkgcheck.checks.git.EAPIChangeWithoutRevbump(pkg, **kwargs)[source]

Bases: PackageResult, Warning

Package has changed EAPI without revbump.

The package has changed EAPI without a new revision. An EAPI bump might affect the installed files (EAPI changes, eclass functions may change behavior, new portage features might be used, etc.). The change should also be reflected in the vdb’s EAPI file.

desc = 'changed EAPI without new revision'
name = 'EAPIChangeWithoutRevbump'
class pkgcheck.checks.git.EbuildIncorrectCopyright(year, line, **kwargs)[source]

Bases: IncorrectCopyright, VersionResult

Changed ebuild with incorrect copyright date.

name = 'IncorrectCopyright'
class pkgcheck.checks.git.EclassIncorrectCopyright(year, line, **kwargs)[source]

Bases: IncorrectCopyright, EclassResult

Changed eclass with incorrect copyright date.

property desc

Result description.

name = 'IncorrectCopyright'
class pkgcheck.checks.git.GitCommitMessageCheck(*args)[source]

Bases: GentooRepoCheck, GitCommitsCheck

Check unpushed git commit messages for various issues.

feed(commit: GitCommit)[source]

Handle functionality against the passed in item.

git_cat_file

Start a git cat-file process to verify git repo hashes.

known_results = frozenset({<class 'pkgcheck.checks.git.BadCommitSummary'>, <class 'pkgcheck.checks.git.InvalidCommitMessage'>, <class 'pkgcheck.checks.git.InvalidCommitTag'>, <class 'pkgcheck.checks.git.MissingSignOff'>})
known_tags = {'Bug': (<function GitCommitMessageCheck._bug_tag>, False), 'Closes': (<function GitCommitMessageCheck._bug_tag>, False), 'Fixes': (<function GitCommitMessageCheck._commit_tag>, False), 'Gentoo-Bug': (<function GitCommitMessageCheck._deprecated_tag>, False), 'Reverts': (<function GitCommitMessageCheck._commit_tag>, False), 'Signed-off-by': (<function GitCommitMessageCheck._signed_off_by_tag>, True)}
scope = <ConditionalScope desc='commit' @0x7f4ee7e99650>
skipped_categories = frozenset({'acct-group', 'acct-user', 'virtual'})
class pkgcheck.checks.git.GitCommitsRepoSource(options, git_addon: GitAddon)[source]

Bases: RepoSource

Repository source for locally changed packages in git history.

Parses git log history to determine packages with changes that haven’t been pushed upstream yet.

required_addons = (<class 'pkgcheck.addons.git.GitAddon'>,)
class pkgcheck.checks.git.GitCommitsSource(*args, git_addon: GitAddon)[source]

Bases: Source

Source for local commits in git history.

Parses git log history to determine commits that haven’t been pushed upstream yet.

required_addons = (<class 'pkgcheck.addons.git.GitAddon'>,)
scope = <ConditionalScope desc='commit' @0x7f4ee7e99650>
class pkgcheck.checks.git.GitEclassCommitsCheck(*args)[source]

Bases: GentooRepoCheck, GitCommitsCheck

Check unpushed git eclass commits for various issues.

feed(eclass)[source]

Handle functionality against the passed in item.

known_results = frozenset({<class 'pkgcheck.checks.git.EclassIncorrectCopyright'>})
scope = <LocationScope desc='eclass' @0x7f4ee7e9ac10>
class pkgcheck.checks.git.GitPkgCommitsCheck(*args, git_addon: GitAddon, eclass_addon: EclassAddon)[source]

Bases: GentooRepoCheck, GitCommitsCheck

Check unpushed git package commits for various issues.

added_repo

Create/load cached repo of packages added to git.

addition_checks(pkgs)[source]

Check for issues due to package additions.

allowed_direct_stable = frozenset({'acct-group', 'acct-user'})
cleanup()[source]

Do cleanup here.

env_array_elem_regex = re.compile('\\[\\d+\\]="(?P<val>.+?)"')
feed(pkgset: list[GitPkgChange])[source]

Handle functionality against the passed in item.

known_results = frozenset({<class 'pkgcheck.checks.git.DirectNoMaintainer'>, <class 'pkgcheck.checks.git.DirectStableKeywords'>, <class 'pkgcheck.checks.git.DroppedStableKeywords'>, <class 'pkgcheck.checks.git.DroppedUnstableKeywords'>, <class 'pkgcheck.checks.git.EAPIChangeWithoutRevbump'>, <class 'pkgcheck.checks.git.EbuildIncorrectCopyright'>, <class 'pkgcheck.checks.git.MissingMove'>, <class 'pkgcheck.checks.git.MissingSlotmove'>, <class 'pkgcheck.checks.git.NewerEAPIAvailable'>, <class 'pkgcheck.checks.git.OldPythonCompat'>, <class 'pkgcheck.checks.git.PythonPEP517WithoutRevbump'>, <class 'pkgcheck.checks.git.RdependChange'>, <class 'pkgcheck.checks.git.SrcUriChecksumChange'>, <class 'pkgcheck.checks.git.SuspiciousSrcUriChange'>})
modified_checks(pkgs, added)[source]

Check for issues due to package modifications.

modified_repo

Create a repository of old packages newly modified in git.

python_compat_declare_regex = re.compile('^declare -a PYTHON_COMPAT=(?P<value>.+)$')
python_pep517_regex = re.compile('^DISTUTILS_USE_PEP517=')
removal_checks(pkgs)[source]

Check for issues due to package removals.

removal_repo

Create a repository of packages removed from git.

rename_checks(pkgs)[source]

Check for issues due to package modifications.

required_addons = (<class 'pkgcheck.addons.git.GitAddon'>, <class 'pkgcheck.addons.eclass.EclassAddon'>)
scope = <PackageScope desc='package' @0x7f4ee7e994d0>
src_uri_changes(pkgset)[source]
class pkgcheck.checks.git.IncorrectCopyright(year, line, **kwargs)[source]

Bases: AliasResult, Warning

Changed file with incorrect copyright date.

property desc

Result description.

name = 'IncorrectCopyright'
class pkgcheck.checks.git.InvalidCommitMessage(error, **kwargs)[source]

Bases: CommitResult, Style

Local commit has issues with its commit message.

property desc

Result description.

name = 'InvalidCommitMessage'
class pkgcheck.checks.git.InvalidCommitTag(tag: str, value: str, error: str, **kwargs)[source]

Bases: CommitResult, Style

Local commit has a tag that is incompliant.

Commit tags have restrictions as to the allowed format and data used per GLEP 66 [2].

property desc

Result description.

name = 'InvalidCommitTag'
class pkgcheck.checks.git.MissingMove(old, new, **kwargs)[source]

Bases: PackageResult, Error

Package was renamed without adding a move package update.

When moving/renaming a package, a new entry must be created in profiles/updates. See the devmanual [3] for more info.

property desc

Result description.

name = 'MissingMove'
class pkgcheck.checks.git.MissingSignOff(missing_sign_offs, **kwargs)[source]

Bases: CommitResult, Error

Local commit with missing sign offs.

Sign offs are required for commits as specified by GLEP 76 [4]. Note that sign off tags will be flagged if the name or email address doesn’t match the values used by the commit author.

property desc

Result description.

name = 'MissingSignOff'
class pkgcheck.checks.git.MissingSlotmove(old, new, **kwargs)[source]

Bases: VersionResult, Error

Package SLOT was changed without adding a slotmove package update.

When changing an existing ebuild’s SLOT, a new entry must be created in profiles/updates. See the devmanual [5] for more info.

property desc

Result description.

name = 'MissingSlotmove'
class pkgcheck.checks.git.NewerEAPIAvailable(eapi: int, **kwargs)[source]

Bases: VersionResult, Warning

Package is eligible for a newer EAPI.

A new package version was added, using an older EAPI, than all supported by inherited eclasses. You should consider bumping the EAPI to the suggested value.

property desc

Result description.

name = 'NewerEAPIAvailable'
class pkgcheck.checks.git.OldPythonCompat(old_targets, **kwargs)[source]

Bases: VersionResult, Warning

Package still lists old targets in PYTHON_COMPAT.

property desc

Result description.

name = 'OldPythonCompat'
class pkgcheck.checks.git.PythonPEP517WithoutRevbump(pkg, **kwargs)[source]

Bases: PackageResult, Warning

Package has started/stopped using DISTUTILS_USE_PEP517 without revbump.

The package has started or stopped using DISTUTILS_USE_PEP517 without a new revision. PEP517 affects the files installed by a package and might lead to some files missing.

desc = 'changed DISTUTILS_USE_PEP517 without new revision'
name = 'PythonPEP517WithoutRevbump'
class pkgcheck.checks.git.RdependChange(pkg, **kwargs)[source]

Bases: VersionResult, Warning

Package RDEPEND was modified without adding a new ebuild revision.

property desc

Result description.

name = 'RdependChange'
class pkgcheck.checks.git.SrcUriChecksumChange(filename, **kwargs)[source]

Bases: PackageResult, Error

SRC_URI changing checksum without distfile rename.

property desc

Result description.

name = 'SrcUriChecksumChange'
class pkgcheck.checks.git.SuspiciousSrcUriChange(old_uri: str, new_uri: str, filename: str, **kwargs)[source]

Bases: PackageResult, Warning

Suspicious SRC_URI changing URI without distfile rename.

property desc

Result description.

name = 'SuspiciousSrcUriChange'
pkgcheck.checks.git.verify_tags(*tags: str, required: bool = False)[source]

Decorator to register commit tag verification methods.