mozlint.formatters package


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 = u'{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.

fmt = u' {c1}{lineno}{column} {c2}{level}{normal} {message} {c1}{rule}({linter}){normal}'
fmt_summary = u'{t.bold}{c}\u2716 {problem} ({error}, {warning}{failure}){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 = u'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 = u'{path}:{lineno}:{column} {rule} {level}: {message}'

Module contents

class mozlint.formatters.JSONFormatter

Bases: object

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