pkgcheck.checks.metadata_xml module

class pkgcheck.checks.metadata_xml.CatBadlyFormedXml(filename, error, **kwargs)[source]

Bases: _BadlyFormedXml, CategoryResult

Badly formed category metadata.xml.

name = 'CatBadlyFormedXml'
class pkgcheck.checks.metadata_xml.CatInvalidXml(filename, message, **kwargs)[source]

Bases: _InvalidXml, CategoryResult

Invalid category metadata.xml.

name = 'CatInvalidXml'
class pkgcheck.checks.metadata_xml.CatMetadataXmlEmptyElement(filename, element, line, **kwargs)[source]

Bases: _MetadataXmlEmptyElement, CategoryResult

Empty element in category metadata.xml file.

name = 'CatMetadataXmlEmptyElement'
class pkgcheck.checks.metadata_xml.CatMetadataXmlIndentation(filename, **kwargs)[source]

Bases: _MetadataXmlIndentation, CategoryResult

Inconsistent indentation in category metadata.xml file.

Either all tabs or all spaces should be used, not a mixture of both.

name = 'CatMetadataXmlIndentation'
class pkgcheck.checks.metadata_xml.CatMetadataXmlInvalidCatRef(filename, cattext, **kwargs)[source]

Bases: _MetadataXmlInvalidCatRef, CategoryResult

Invalid category reference in category metadata.xml.

name = 'CatMetadataXmlInvalidCatRef'
class pkgcheck.checks.metadata_xml.CatMetadataXmlInvalidPkgRef(filename, pkgtext, **kwargs)[source]

Bases: _MetadataXmlInvalidPkgRef, CategoryResult

Invalid package reference in category metadata.xml.

name = 'CatMetadataXmlInvalidPkgRef'
class pkgcheck.checks.metadata_xml.CatMissingMetadataXml(filename, **kwargs)[source]

Bases: _MissingXml, CategoryResult

Category is missing metadata.xml.

name = 'CatMissingMetadataXml'
class pkgcheck.checks.metadata_xml.CategoryMetadataXmlCheck(*args)[source]

Bases: _XmlBaseCheck

Category level metadata.xml scans.

catref_error

alias of CatMetadataXmlInvalidCatRef

empty_element

alias of CatMetadataXmlEmptyElement

indent_error

alias of CatMetadataXmlIndentation

invalid_error

alias of CatInvalidXml

known_results = frozenset({<class 'pkgcheck.checks.metadata_xml.CatBadlyFormedXml'>, <class 'pkgcheck.checks.metadata_xml.CatInvalidXml'>, <class 'pkgcheck.checks.metadata_xml.CatMetadataXmlEmptyElement'>, <class 'pkgcheck.checks.metadata_xml.CatMetadataXmlIndentation'>, <class 'pkgcheck.checks.metadata_xml.CatMetadataXmlInvalidCatRef'>, <class 'pkgcheck.checks.metadata_xml.CatMetadataXmlInvalidPkgRef'>, <class 'pkgcheck.checks.metadata_xml.CatMissingMetadataXml'>})
misformed_error

alias of CatBadlyFormedXml

missing_error

alias of CatMissingMetadataXml

pkgref_error

alias of CatMetadataXmlInvalidPkgRef

scope = <PackageScope desc='category' @0x7fc9bedc9110>
class pkgcheck.checks.metadata_xml.InvalidMetadataRestrict(restrict: str, msg: str, **kwargs)[source]

Bases: PackageResult, Error

Invalid package restrictions used in metadata.xml.

property desc

Result description.

name = 'InvalidMetadataRestrict'
class pkgcheck.checks.metadata_xml.InvalidRemoteID(id_type, id_value, expected, **kwargs)[source]

Bases: PackageResult, Warning

Package’s remote-id value incorrect for the specified type.

property desc

Result description.

name = 'InvalidRemoteID'
class pkgcheck.checks.metadata_xml.MaintainerNeeded(filename, needed, **kwargs)[source]

Bases: PackageResult, Warning

Package with missing or invalid maintainer-needed comment in metadata.xml.

property desc

Result description.

name = 'MaintainerNeeded'
class pkgcheck.checks.metadata_xml.MaintainerWithoutProxy(filename, maintainers, **kwargs)[source]

Bases: PackageResult, Warning

Package has a proxied maintainer without a proxy.

All package maintainers have non-@gentoo.org e-mail addresses. Most likely, this means that the package is maintained by a proxied maintainer but there is no explicit proxy (developer or project) listed. This means no Gentoo developer will be CC-ed on bug reports, and most likely no developer oversees the proxied maintainer’s activity.

property desc

Result description.

name = 'MaintainerWithoutProxy'
class pkgcheck.checks.metadata_xml.MissingRemoteId(remote_type: str, value: str, uri: str, **kwarg)[source]

Bases: PackageResult, Info

Missing remote-id which was inferred from ebuilds.

Based on URIs found in SRC_URI and HOMEPAGE, a remote-id can be suggested. If a remote-id of same type is already defined in metadata.xml, the suggestion won’t be reported. It ignores URIs ending with .diff or .patch, as they might point to a fork or developer’s space. It also ignores URIs that are conditional on USE flags.

property desc

Result description.

name = 'MissingRemoteId'
class pkgcheck.checks.metadata_xml.MissingRemoteIdCheck(options, **kwargs)[source]

Bases: Check

Detect missing remote-ids based on SRC_URI and HOMEPAGE.

feed(pkgset)[source]

Handle functionality against the passed in item.

known_results = frozenset({<class 'pkgcheck.checks.metadata_xml.MissingRemoteId'>})
remotes_map = (('bitbucket', 'https://bitbucket.org/(?P<value>[^/]+/[^/]+)'), ('codeberg', 'https://codeberg.org/(?P<value>[^/]+/[^/]+)'), ('freedesktop-gitlab', 'https://gitlab.freedesktop.org/(?P<value>((?!api/)\\w[^/]*/)+(?!raw/)\\w[^/]*)'), ('github', 'https://github.com/(?P<value>[^/]+/[^/]+)'), ('gitlab', 'https://gitlab.com/(?P<value>((?!api/)\\w[^/]*/)+(?!raw/)\\w[^/]*)'), ('gnome-gitlab', 'https://gitlab.gnome.org/(?P<value>((?!api/)\\w[^/]*/)+(?!raw/)\\w[^/]*)'), ('heptapod', 'https://foss.heptapod.net/(?P<value>((?!api/)\\w[^/]*/)+(?!raw/)\\w[^/]*)'), ('kde-invent', 'https://invent.kde.org/(?P<value>((?!api/)\\w[^/]*/)+(?!raw/)\\w[^/]*)'), ('launchpad', 'https://launchpad.net/(?P<value>[^/]+)'), ('pypi', 'https://pypi.org/project/(?P<value>[^/]+)'), ('pypi', 'https://files.pythonhosted.org/packages/source/\\S/(?P<value>[^/]+)'), ('savannah', 'https://savannah.gnu.org/projects/(?P<value>[^/]+)'), ('savannah-nongnu', 'https://savannah.nongnu.org/projects/(?P<value>[^/]+)'), ('sourceforge', 'https://downloads.sourceforge.(net|io)/(?:project/)?(?P<value>[^/]+)'), ('sourceforge', 'https://sourceforge.(net|io)/projects/(?P<value>[^/]+)'), ('sourceforge', 'https://(?P<value>[^/]+).sourceforge.(net|io)/'), ('sourcehut', 'https://sr.ht/(?P<value>[^/]+/[^/]+)'))
scope = <PackageScope desc='package' @0x7fc9bedc8f50>
class pkgcheck.checks.metadata_xml.NonexistentProjectMaintainer(filename, emails, **kwargs)[source]

Bases: PackageResult, Warning

Package specifying nonexistent project as a maintainer.

property desc

Result description.

name = 'NonexistentProjectMaintainer'
class pkgcheck.checks.metadata_xml.PackageMetadataXmlCheck(*args)[source]

Bases: _XmlBaseCheck

Package level metadata.xml scans.

catref_error

alias of PkgMetadataXmlInvalidCatRef

empty_element

alias of PkgMetadataXmlEmptyElement

indent_error

alias of PkgMetadataXmlIndentation

invalid_error

alias of PkgInvalidXml

known_results = frozenset({<class 'pkgcheck.checks.metadata_xml.InvalidMetadataRestrict'>, <class 'pkgcheck.checks.metadata_xml.InvalidRemoteID'>, <class 'pkgcheck.checks.metadata_xml.MaintainerNeeded'>, <class 'pkgcheck.checks.metadata_xml.MaintainerWithoutProxy'>, <class 'pkgcheck.checks.metadata_xml.NonexistentProjectMaintainer'>, <class 'pkgcheck.checks.metadata_xml.PkgBadlyFormedXml'>, <class 'pkgcheck.checks.metadata_xml.PkgInvalidXml'>, <class 'pkgcheck.checks.metadata_xml.PkgMetadataXmlEmptyElement'>, <class 'pkgcheck.checks.metadata_xml.PkgMetadataXmlIndentation'>, <class 'pkgcheck.checks.metadata_xml.PkgMetadataXmlInvalidCatRef'>, <class 'pkgcheck.checks.metadata_xml.PkgMetadataXmlInvalidPkgRef'>, <class 'pkgcheck.checks.metadata_xml.PkgMissingMetadataXml'>, <class 'pkgcheck.checks.metadata_xml.ProxyWithoutProxied'>, <class 'pkgcheck.checks.metadata_xml.RedundantLongDescription'>, <class 'pkgcheck.checks.metadata_xml.WrongMaintainerType'>})
misformed_error

alias of PkgBadlyFormedXml

missing_error

alias of PkgMissingMetadataXml

pkgref_error

alias of PkgMetadataXmlInvalidPkgRef

remote_id_validators = {'bitbucket': (re.compile('^[^/]+/[^/]+$'), '{username}/{project}'), 'codeberg': (re.compile('^[^/]+/[^/]+$'), '{username}/{project}'), 'cpan': (re.compile('^[^/]+$'), '{project}'), 'cpan-module': (re.compile('^[^/]+$'), '{module}'), 'cpe': (re.compile('^cpe:/[aho]:[^:]+:[^:]+$'), 'cpe:/[aho]:{vendor}:{product}'), 'cran': (re.compile('^[^/]+$'), '{project}'), 'ctan': (re.compile('^[^/]+$'), '{project}'), 'gentoo': (re.compile('^([^/]+/)*[^/]+(?<!\\.git)$'), '[{group}/...]{repo}'), 'github': (re.compile('^[^/]+/[^/]+$'), '{username}/{project}'), 'gitlab': (re.compile('^([^/]+/)*[^/]+/[^/]+$'), '{username}/[{group}/...]{repo}'), 'google-code': (re.compile('^[^/]+$'), '{project}'), 'heptapod': (re.compile('^([^/]+/)*[^/]+/[^/]+$'), '{username}/[{group}/...]{repo}'), 'launchpad': (re.compile('^(?!lp:)[^/]+$'), '{project}'), 'osdn': (re.compile('^[^/]+$'), '{project}'), 'pear': (re.compile('^[^/]+$'), '{project}'), 'pecl': (re.compile('^[^/]+$'), '{project}'), 'pypi': (re.compile('^[^/]+$'), '{project}'), 'rubygems': (re.compile('^[^/]+$'), '{project}'), 'sourceforge': (re.compile('^[^/]+$'), '{project}'), 'vim': (re.compile('^[1-9]\\d*$'), '{script_id}')}
scope = <PackageScope desc='package' @0x7fc9bedc8f50>
class pkgcheck.checks.metadata_xml.PkgBadlyFormedXml(filename, error, **kwargs)[source]

Bases: _BadlyFormedXml, PackageResult

Badly formed package metadata.xml.

name = 'PkgBadlyFormedXml'
class pkgcheck.checks.metadata_xml.PkgInvalidXml(filename, message, **kwargs)[source]

Bases: _InvalidXml, PackageResult

Invalid package metadata.xml.

name = 'PkgInvalidXml'
class pkgcheck.checks.metadata_xml.PkgMetadataXmlEmptyElement(filename, element, line, **kwargs)[source]

Bases: _MetadataXmlEmptyElement, PackageResult

Empty element in package metadata.xml file.

name = 'PkgMetadataXmlEmptyElement'
class pkgcheck.checks.metadata_xml.PkgMetadataXmlIndentation(filename, **kwargs)[source]

Bases: _MetadataXmlIndentation, PackageResult

Inconsistent indentation in package metadata.xml file.

Either all tabs or all spaces should be used, not a mixture of both.

name = 'PkgMetadataXmlIndentation'
class pkgcheck.checks.metadata_xml.PkgMetadataXmlInvalidCatRef(filename, cattext, **kwargs)[source]

Bases: _MetadataXmlInvalidCatRef, PackageResult

Invalid category reference in package metadata.xml.

name = 'PkgMetadataXmlInvalidCatRef'
class pkgcheck.checks.metadata_xml.PkgMetadataXmlInvalidPkgRef(filename, pkgtext, **kwargs)[source]

Bases: _MetadataXmlInvalidPkgRef, PackageResult

Invalid package reference in package metadata.xml.

name = 'PkgMetadataXmlInvalidPkgRef'
class pkgcheck.checks.metadata_xml.PkgMissingMetadataXml(filename, **kwargs)[source]

Bases: _MissingXml, PackageResult

Package is missing metadata.xml.

name = 'PkgMissingMetadataXml'
class pkgcheck.checks.metadata_xml.ProxyWithoutProxied(filename, **kwargs)[source]

Bases: PackageResult, Warning

Package lists a proxy with no proxied maintainers.

The package explicitly lists a proxy with no proxied maintainers. Most likely, this means that the proxied maintainer has been removed but the proxy was accidentally left.

property desc

Result description.

name = 'ProxyWithoutProxied'
class pkgcheck.checks.metadata_xml.RedundantLongDescription(msg, **kwargs)[source]

Bases: PackageResult, Style

Package’s longdescription element in metadata.xml and DESCRIPTION are interchangeable.

The longdescription element is for providing extended information that doesn’t fit in DESCRIPTION.

property desc

Result description.

name = 'RedundantLongDescription'
class pkgcheck.checks.metadata_xml.WrongMaintainerType(filename, emails, **kwargs)[source]

Bases: PackageResult, Warning

A person-type maintainer matches an existing project.

property desc

Result description.

name = 'WrongMaintainerType'