mozlint.formatters package

Submodules

mozlint.formatters.compact module

class mozlint.formatters.compact.CompactFormatter(summary=True)

Bases: object

Formatter for compact output.

This formatter prints one error per line, mimicking the eslint ‘compact’ formatter.

fmt = '{path}: line {lineno}{column}, {level} - {message} ({rule})'

mozlint.formatters.stylish module

class mozlint.formatters.stylish.StylishFormatter(disable_colors=False)

Bases: object

Formatter based on the eslint default.

color(color)
fmt = '  {c1}{lineno}{column}  {c2}{level}{normal}  {message}  {c1}{rule}({linter}){normal}\n{diff}'
fmt_summary = '{t.bold}{c}✖ {problem} ({error}, {warning}{failure}, {fixed}){t.normal}'

mozlint.formatters.summary module

class mozlint.formatters.summary.SummaryFormatter(depth=None)

Bases: object

mozlint.formatters.treeherder module

class mozlint.formatters.treeherder.TreeherderFormatter

Bases: object

Formatter for treeherder friendly output.

This formatter looks ugly, but prints output such that treeherder is able to highlight the errors and warnings. This is a stop-gap until bug 1276486 is fixed.

fmt = 'TEST-UNEXPECTED-{level} | {path}:{lineno}{column} | {message} ({rule})'

mozlint.formatters.unix module

class mozlint.formatters.unix.UnixFormatter

Bases: object

Formatter that respects Unix output conventions frequently employed by preprocessors and compilers. The format is <FILENAME>:<LINE>[:<COL>]: <RULE> <LEVEL>: <MESSAGE>.

fmt = '{path}:{lineno}:{column} {rule} {level}: {message}'

Module contents

class mozlint.formatters.JSONFormatter

Bases: object

mozlint.formatters.get(name, **fmtargs)