pkgcheck.checks.whitespace module

Various whitespace-related checks.

class pkgcheck.checks.whitespace.BadWhitespaceCharacter(char, position, **kwargs)[source]

Bases: LineResult, Warning

Ebuild uses whitespace that isn’t a tab, newline, or single space.

Bash does not treat unicode whitespace characters as regular whitespace so commands or operators separated by such characters will be treated as one string. This usually causes execution errors if the characters are used for separation purposes outside of comments or regular strings.

property desc

Result description.

name = 'BadWhitespaceCharacter'
class pkgcheck.checks.whitespace.DoubleEmptyLine(lines, *args, **kwargs)[source]

Bases: _Whitespace

Unneeded blank lines found.

property desc

Result description.

name = 'DoubleEmptyLine'
class pkgcheck.checks.whitespace.MissingEAPIBlankLine(pkg, **kwargs)[source]

Bases: VersionResult, Style

Missing blank line after EAPI= assignment.

desc = 'missing blank line after EAPI= assignment'
name = 'MissingEAPIBlankLine'
class pkgcheck.checks.whitespace.MissingWhitespaceCheck(options, **kwargs)[source]

Bases: OptionalCheck

Scan ebuild for missing whitespace.

feed(pkg)[source]

Handle functionality against the passed in item.

known_results = frozenset({<class 'pkgcheck.checks.whitespace.MissingEAPIBlankLine'>})
scope = <PackageScope desc='version' @0x7f4ee7e995d0>
class pkgcheck.checks.whitespace.NoFinalNewline(pkg, **kwargs)[source]

Bases: VersionResult, Style

Ebuild’s last line does not have a final newline.

desc = 'ebuild lacks an ending newline'
name = 'NoFinalNewline'
class pkgcheck.checks.whitespace.TrailingEmptyLine(pkg, **kwargs)[source]

Bases: VersionResult, Style

Unneeded trailing blank lines found.

desc = 'ebuild has trailing blank line(s)'
name = 'TrailingEmptyLine'
class pkgcheck.checks.whitespace.WhitespaceCheck(*args)[source]

Bases: Check

Scan ebuild for useless whitespace.

feed(pkg)[source]

Handle functionality against the passed in item.

known_results = frozenset({<class 'pkgcheck.checks.whitespace.BadWhitespaceCharacter'>, <class 'pkgcheck.checks.whitespace.DoubleEmptyLine'>, <class 'pkgcheck.checks.whitespace.NoFinalNewline'>, <class 'pkgcheck.checks.whitespace.TrailingEmptyLine'>, <class 'pkgcheck.checks.whitespace.WhitespaceFound'>, <class 'pkgcheck.checks.whitespace.WrongIndentFound'>})
scope = <PackageScope desc='version' @0x7f4ee7e995d0>
class pkgcheck.checks.whitespace.WhitespaceData(unicode_version: str, chars: tuple)[source]

Bases: NamedTuple

Data format to register hardcoded list of bad whitespace characters.

chars: tuple

Alias for field number 1

unicode_version: str

Alias for field number 0

class pkgcheck.checks.whitespace.WhitespaceFound(leadtrail, **kwargs)[source]

Bases: _Whitespace

Leading or trailing whitespace found.

property desc

Result description.

name = 'WhitespaceFound'
class pkgcheck.checks.whitespace.WrongIndentFound(lines, *args, **kwargs)[source]

Bases: _Whitespace

Incorrect indentation whitespace found.

property desc

Result description.

name = 'WrongIndentFound'