Mixins provided by mtrchk.org.momotor.render.diff

checklet mixin class mtrchk.org.momotor.render.diff.mixin.RenderDiffMixin

Mixin for checklets to render a diff of two files.

font option

Font name(s) to use for the diff output. Multiple fonts can be specified, separated by commas

Type:

Any

Required:

False

Multiple:

False

Location:

config, step, recipe

Default:

Consolas,"Courier New",monospace

left-header option

Diff table left header

Type:

Any

Required:

False

Multiple:

False

Location:

config, step, recipe

Default:

Left

right-header option

Diff table right header

Type:

Any

Required:

False

Multiple:

False

Location:

config, step, recipe

Default:

Right

diff-tab-size option

Expand tabs in the diff to this many spaces

Type:

integer

Required:

False

Multiple:

False

Location:

config, step, recipe

Default:

4

diff-columns option

Diff table column width

Type:

integer

Required:

False

Multiple:

False

Location:

config, step, recipe

Default:

60

diff-context-lines option

Amount of context to show on the diff. -1 for full diff

Type:

integer

Required:

False

Multiple:

False

Location:

config, step, recipe

Default:

4

ignore-final-newline option

Ignore difference in final newline

Type:

boolean

Required:

False

Multiple:

False

Location:

config, step, recipe

Default:

False

diff_result(left, right, *, fail_if_too_big=False, header='')

Generate the diff and return a CheckletResult with an outcome and the HTML diff as the report.

Parameters:
  • left (File) – Left-side file

  • right (File) – Right-side file

  • fail_if_too_big (bool) – If True, the checklet will fail if the diff is too big to show.

  • header (str) – Header to prepend to the HTML diff

Return type:

CheckletResult

Returns:

The result with the outcome and the HTML diff as the report