pkgcheck.checks.eclass module

class pkgcheck.checks.eclass.DeprecatedEclass(eclass, replacement, **kwargs)[source]

Bases: VersionResult, Warning

Package uses an eclass that is deprecated/abandoned.

property desc

Result description.

name = 'DeprecatedEclass'
class pkgcheck.checks.eclass.DeprecatedEclassFunction(function, replacement, **kwargs)[source]

Bases: LineResult, Warning

Package uses a deprecated function from an eclass.

property desc

Result description.

name = 'DeprecatedEclassFunction'
class pkgcheck.checks.eclass.DeprecatedEclassVariable(variable, replacement, **kwargs)[source]

Bases: LineResult, Warning

Package uses a deprecated variable from an eclass.

property desc

Result description.

name = 'DeprecatedEclassVariable'
class pkgcheck.checks.eclass.DuplicateEclassInherit(eclass, **kwargs)[source]

Bases: LineResult, Style

An ebuild directly inherits the same eclass multiple times.

Note that this will flag ebuilds that conditionalize global metadata by package version (or some other fashion) while inheriting the same eclass under both branches, e.g. conditional live ebuilds. In this case, shared eclasses should be loaded in a separate, unconditional inherit call.

property desc

Result description.

name = 'DuplicateEclassInherit'
class pkgcheck.checks.eclass.EclassBashSyntaxError(lineno, error, **kwargs)[source]

Bases: EclassResult, Error

Bash syntax error in the related eclass.

property desc

Result description.

name = 'EclassBashSyntaxError'
class pkgcheck.checks.eclass.EclassCheck(*args)[source]

Bases: Check

Scan eclasses for various issues.

feed(eclass)[source]

Handle functionality against the passed in item.

known_results = frozenset({<class 'pkgcheck.checks.eclass.EclassBashSyntaxError'>, <class 'pkgcheck.checks.eclass.EclassDocError'>, <class 'pkgcheck.checks.eclass.EclassDocMissingFunc'>, <class 'pkgcheck.checks.eclass.EclassDocMissingVar'>})
scope = <LocationScope desc='eclass' @0x7fc9bedc9610>
class pkgcheck.checks.eclass.EclassDocError(error, **kwargs)[source]

Bases: EclassResult, Warning

Error when parsing docs for the related eclass.

Eclass docs are parsed as specified by the devmanual [1].

property desc

Result description.

name = 'EclassDocError'
class pkgcheck.checks.eclass.EclassDocMissingFunc(functions, **kwargs)[source]

Bases: EclassResult, Warning

Undocumented function(s) in the related eclass.

property desc

Result description.

name = 'EclassDocMissingFunc'
class pkgcheck.checks.eclass.EclassDocMissingVar(variables, **kwargs)[source]

Bases: EclassResult, Warning

Undocumented variable(s) in the related eclass.

All exported variables in an eclass should be documented using eclass doc tags. Temporary variables should be unset after use so they aren’t exported.

property desc

Result description.

name = 'EclassDocMissingVar'
class pkgcheck.checks.eclass.EclassExportFuncsBeforeInherit(export_line, inherit_line, **kwargs)[source]

Bases: EclassResult, Error

EXPORT_FUNCTIONS called before inherit.

The EXPORT_FUNCTIONS call should occur after all inherits are done in order to guarantee consistent behavior across all package managers.

property desc

Result description.

name = 'EclassExportFuncsBeforeInherit'
class pkgcheck.checks.eclass.EclassManualDepsCheck(options, **kwargs)[source]

Bases: Check

Check for missing deps when inheriting eclasses in special mode.

dependencies = (('cargo', 'CARGO_OPTIONAL', {'virtual/rust'}, <class 'pkgcheck.checks.eclass.RustMissingDeps'>), ('go-module', 'GO_OPTIONAL', {'dev-lang/go'}, <class 'pkgcheck.checks.eclass.GoMissingDeps'>), ('ruby-ng', 'RUBY_OPTIONAL', {'dev-lang/ruby', 'dev-ruby', 'virtual/rubygems'}, <class 'pkgcheck.checks.eclass.RubyMissingDeps'>), ('tmpfiles', 'TMPFILES_OPTIONAL', {'virtual/tmpfiles'}, <class 'pkgcheck.checks.eclass.TmpfilesMissingDeps'>))
feed(pkg: ParseTree)[source]

Handle functionality against the passed in item.

known_results = frozenset({<class 'pkgcheck.checks.eclass.GoMissingDeps'>, <class 'pkgcheck.checks.eclass.RubyMissingDeps'>, <class 'pkgcheck.checks.eclass.RustMissingDeps'>, <class 'pkgcheck.checks.eclass.TmpfilesMissingDeps'>})
scope = <PackageScope desc='version' @0x7fc9bedc9290>
class pkgcheck.checks.eclass.EclassParseCheck(*args, eclass_addon)[source]

Bases: Check

Scan eclasses variables that are only allowed in certain scopes.

eclass_phase_vars(eclass, phase)[source]

Return set of bad variables for a given eclass and potential phase function.

feed(eclass)[source]

Handle functionality against the passed in item.

known_results = frozenset({<class 'pkgcheck.checks.eclass.EclassExportFuncsBeforeInherit'>, <class 'pkgcheck.checks.eclass.EclassVariableScope'>})
required_addons = (<class 'pkgcheck.addons.eclass.EclassAddon'>,)
scope = <LocationScope desc='eclass' @0x7fc9bedc9610>
class pkgcheck.checks.eclass.EclassUsageCheck(*args, eclass_addon)[source]

Bases: Check

Scan packages for various eclass-related issues.

check_deprecated_functions(pkg, inherits: list[tuple[list[str], int]])[source]

Check for usage of @DEPRECATED functions.

check_deprecated_variables(pkg, inherits: list[tuple[list[str], int]])[source]

Check for usage of @DEPRECATED variables.

check_pre_inherits(pkg, inherits: list[tuple[list[str], int]])[source]

Check for invalid @PRE_INHERIT variable placement.

check_provided_eclasses(pkg, inherits: list[tuple[list[str], int]])[source]

Check for usage of eclasses (i.e. redundant inherits) that are provided by another inherited eclass.

check_user_variables(pkg: ParseTree, inherits: list[tuple[list[str], int]])[source]

Check for usage of @USER_VARIABLE variables.

feed(pkg)[source]

Handle functionality against the passed in item.

known_results = frozenset({<class 'pkgcheck.checks.eclass.DeprecatedEclass'>, <class 'pkgcheck.checks.eclass.DeprecatedEclassFunction'>, <class 'pkgcheck.checks.eclass.DeprecatedEclassVariable'>, <class 'pkgcheck.checks.eclass.DuplicateEclassInherit'>, <class 'pkgcheck.checks.eclass.EclassUserVariableUsage'>, <class 'pkgcheck.checks.eclass.MisplacedEclassVar'>, <class 'pkgcheck.checks.eclass.ProvidedEclassInherit'>})
required_addons = (<class 'pkgcheck.addons.eclass.EclassAddon'>,)
scope = <PackageScope desc='version' @0x7fc9bedc9290>
class pkgcheck.checks.eclass.EclassUserVariableUsage(eclass, **kwargs)[source]

Bases: LineResult, Warning

Package uses a user variable from an eclass.

property desc

Result description.

name = 'EclassUserVariableUsage'
class pkgcheck.checks.eclass.EclassVariableScope(variable, func, **kwargs)[source]

Bases: VariableScope, EclassResult

Eclass using variable outside its defined scope.

property desc

Result description.

name = 'VariableScope'
class pkgcheck.checks.eclass.GoMissingDeps(pkg, **kwargs)[source]

Bases: VersionResult, Warning

Package sets GO_OPTIONAL but does not depend on dev-lang/go.

desc = 'sets GO_OPTIONAL but does not depend on dev-lang/go'
name = 'GoMissingDeps'
class pkgcheck.checks.eclass.MisplacedEclassVar(variable, **kwargs)[source]

Bases: LineResult, Error

Invalid placement of pre-inherit eclass variable in an ebuild.

All eclass variables tagged with @PRE_INHERIT must be set before the first inherit call in an ebuild.

property desc

Result description.

name = 'MisplacedEclassVar'
class pkgcheck.checks.eclass.ProvidedEclassInherit(provider, **kwargs)[source]

Bases: LineResult, Style

Ebuild inherits an eclass which is already provided by another eclass.

When inheriting an eclass which declares @PROVIDES, those referenced eclasses are guaranteed to be provided by the eclass. Therefore, inheriting them in ebuilds is redundant and should be removed.

property desc

Result description.

name = 'ProvidedEclassInherit'
class pkgcheck.checks.eclass.RubyMissingDeps(pkg, **kwargs)[source]

Bases: VersionResult, Warning

Package sets RUBY_OPTIONAL but does not depend on dev-lang/ruby or virtual/rubygems.

desc = 'sets RUBY_OPTIONAL but does not depend on dev-lang/ruby or virtual/rubygems'
name = 'RubyMissingDeps'
class pkgcheck.checks.eclass.RustMissingDeps(pkg, **kwargs)[source]

Bases: VersionResult, Warning

Package sets CARGO_OPTIONAL but does not depend on virtual/rust.

desc = 'sets CARGO_OPTIONAL but does not depend on virtual/rust'
name = 'RustMissingDeps'
class pkgcheck.checks.eclass.TmpfilesMissingDeps(pkg, **kwargs)[source]

Bases: VersionResult, Warning

Package sets TMPFILES_OPTIONAL but does not depend on virtual/tmpfiles.

desc = 'sets TMPFILES_OPTIONAL but does not depend on virtual/tmpfiles'
name = 'TmpfilesMissingDeps'