pkgcheck.reporters module

Basic result reporters.

class pkgcheck.reporters.CallbackReporter(*callbacks: Callable[[Result], None])[source]

Bases: Reporter

Reporter that calls back for every result

callbacks: list[Callable[[Result], None]]
class pkgcheck.reporters.CsvReporter(out: Formatter)[source]

Bases: StreamReporter

Comma-separated value reporter, convenient for shell processing.

Example:

,,,"global USE flag 'big-endian' is a potential local, used by 1 package: dev-java/icedtea-bin"
sys-apps,portage,2.1-r2,sys-apps/portage-2.1-r2.ebuild has whitespace in indentation on line 169
sys-apps,portage,2.1-r2,"rdepend  ppc-macos: unsolvable default-darwin/macos/10.4, solutions: [ >=app-misc/pax-utils-0.1.13 ]"
sys-apps,portage,2.1-r2,"no change in 75 days, keywords [ ~x86-fbsd ]"
priority: int = -1001
exception pkgcheck.reporters.DeserializationError[source]

Bases: Exception

Exception occurred while deserializing a data stream.

class pkgcheck.reporters.FancyReporter(out: Formatter)[source]

Bases: StreamReporter

Colored output grouped by result scope.

Example:

sys-apps/portage
  WrongIndentFound: sys-apps/portage-2.1-r2.ebuild has whitespace in indentation on line 169
  NonsolvableDeps: sys-apps/portage-2.1-r2: rdepend  ppc-macos: unsolvable default-darwin/macos/10.4, solutions: [ >=app-misc/pax-utils-0.1.13 ]
  StableRequest: sys-apps/portage-2.1-r2: no change in 75 days, keywords [ ~x86 ]
priority: int = 1
class pkgcheck.reporters.FlycheckReporter(out: Formatter)[source]

Bases: StreamReporter

Simple line reporter done for easier integration with flycheck [1] .

priority: int = -1001
class pkgcheck.reporters.FormatReporter(format_str, *args, **kwargs)[source]

Bases: StreamReporter

Custom format string reporter.

This formatter uses custom format string passed using the --format command line argument.

format_str
priority: int = -1001
class pkgcheck.reporters.GithubReporter(out: Formatter)[source]

Bases: StreamReporter

Reporter formatting results as GitHub Actions workflow commands [2].

Results are emitted as error, warning, or notice annotations anchored to the relevant file and line, so they show up on the workflow run summary and inline in pull request diffs.

distfile_results = frozenset({'SrcUriChecksumChange', 'SuspiciousSrcUriChange'})
level_map = {'error': 'error', 'warning': 'warning'}
path_map = {<PackageScope desc='version' @0x7f807bd95480>: '{category}/{package}/{package}-{version}.ebuild', <PackageScope desc='package' @0x7f807bef39d0>: '{category}/{package}/{filename}', <PackageScope desc='category' @0x7f807bef3610>: '{category}/{filename}', <LocationScope desc='eclass' @0x7f807bd74410>: 'eclass/{eclass}.eclass', <LocationScope desc='profiles' @0x7f807bef3b10>: 'profiles/{path}', <LocationScope desc='profile_node' @0x7f807bd717f0>: 'profiles/{path}'}
priority: int = -1001
class pkgcheck.reporters.JsonReporter(out: Formatter)[source]

Bases: StreamReporter

Feed of newline-delimited JSON records.

Note that the format is newline-delimited JSON with each line being related to a separate report. To merge the objects together a tool such as jq can be leveraged similar to the following:

jq -c -s 'reduce.[]as$x({};.*$x)' orig.json > new.json
priority: int = -1000
class pkgcheck.reporters.JsonStream(out: Formatter)[source]

Bases: StreamReporter

Generate a stream of result objects serialized in JSON.

static from_iter(iterable) → Generator[Result, None, None][source]

Deserialize results from a given iterable.

priority: int = -1001
static to_json(obj) → str | dict[str, str][source]

Serialize results and other objects to JSON.

class pkgcheck.reporters.MultiplexingReporter(*args: Reporter)[source]

Bases: Reporter

Reporter that multiplexes results to multiple Reporters

reporters: list[Reporter]
class pkgcheck.reporters.ReportFuncShim(report: Callable[[Result], None])[source]

Bases: object

Compatibility shim while migrating endusers away from using .report()

report
class pkgcheck.reporters.Reporter[source]

Bases: ABC, Simple

Generic result reporter.

priority: int
report
class pkgcheck.reporters.StrReporter(out: Formatter)[source]

Bases: StreamReporter

Simple string reporter, pkgcheck-0.1 behaviour.

Example:

sys-apps/portage-2.1-r2: sys-apps/portage-2.1-r2.ebuild has whitespace in indentation on line 169
sys-apps/portage-2.1-r2: rdepend  ppc-macos: unsolvable default-darwin/macos/10.4, solutions: [ >=app-misc/pax-utils-0.1.13 ]
sys-apps/portage-2.1-r2: no change in 75 days, keywords [ ~x86-fbsd ]
priority: int = 0
class pkgcheck.reporters.StreamReporter(out: Formatter)[source]

Bases: Reporter

out: Formatter
class pkgcheck.reporters.XmlReporter(out: Formatter)[source]

Bases: StreamReporter

Feed of newline-delimited XML reports.

priority: int = -1000