Mixins provided by mtrchk.org.momotor.evaluate.compare¶
- checklet mixin class mtrchk.org.momotor.evaluate.compare.mixin.CompareMixin¶
- ignore-final-newline option¶
Ignore difference in final newline
- Type:
boolean
- Required:
False
- Multiple:
False
- Location:
config, step, recipe
- Default:
False
- ignore-trailing-whitespace option¶
Ignore difference in trailing whitespace for all lines
- Type:
boolean
- Required:
False
- Multiple:
False
- Location:
config, step, recipe
- Default:
False
- sort-left option¶
Sort the left file before comparison. Either a boolean value (
yes,no,true,false, etc.), orhuman,nat,os,realto sort using a natural sort algorithm.See the documentation of the natsort package for details on the natural sort algorithms.
Note
Sorting requires the entire file to be read into memory, which may be undesirable for large files.
- Type:
string
- Required:
False
- Multiple:
False
- Location:
config, step, recipe
- Default:
False
- sort-right option¶
Sort the right file before comparison. Either a boolean value (
yes,no,true,false, etc.), orhuman,nat,os,realto sort using a natural sort algorithm.See the documentation of the natsort package for details on the natural sort algorithms.
Note
Sorting requires the entire file to be read into memory, which may be undesirable for large files.
- Type:
string
- Required:
False
- Multiple:
False
- Location:
config, step, recipe
- Default:
False
- pass-level option¶
When to pass the compare:
identical: Contents must be fully identicalcase: Contents may differ in whitespace, blank lines and casingwhitespace: Contents may differ in whitespace only (excluding blank lines)blank: Contents may differ in whitespace and blank linesdifferent: Contents may differ completely. This will make this step always pass.
Later listed passing levels include earlier listed levels, e.g. if the detected level is
whitespace, the files may also include differences in case.- Type:
Any
- Required:
False
- Multiple:
False
- Location:
config, step, recipe
- Default:
identical
- score option¶
Score when passing a level. A (possibly empty) comma separated list of scores for each level:
[ [ identical-score ] [ "," [ case-score ] [ "," [ whitespace-score ] [ "," [ blank-score ] [ "," [ different-score ] ] ] ] ] ]
Missing values at the end will be the same as the last value in the list, an empty value means no score will be given for that level.
For example, a score definition of
10,9,8will give a score of 10 when the files are identical, 9 when they differ only in case, and 8 otherwise.- Type:
Any
- Required:
False
- Multiple:
False
- Location:
config, step, recipe
- Default:
Empty string
- score-fail option¶
Score when failing to meet the required level. Either a constant score value, string constant
noneto indicate no score when failing, orkeepto keep the score from thescorelist.- Type:
Any
- Required:
False
- Multiple:
False
- Location:
config, step, recipe
- Default:
none
- fail-with-reason option¶
When failing, set the reason property. If false the reason is listed as the status
- Type:
boolean
- Required:
False
- Multiple:
False
- Location:
config, step, recipe
- Default:
True
- compare_report(left, right)¶
Compare two files and return a
CheckletResultwith the outcome and properties based on the given options and the level of difference of the files.- Parameters:
- Return type:
- Returns:
The result
- Raises:
CheckletError – if an option value is invalid