#454 New output for CIF checks (2nd attempt)
- This merge request replaces the previous one, !464 (closed). It was quite some work, but I think I've addressed all the issues. I'm quite happy with the output that is now produced.
- Checks API:
- The design for checks is much simpler, as there are no message classes anymore. Just (formatted) strings.
- I got rid of reporting on ancestors or named objects, requiring
PositionObject
objects with a position. - No more reporting on
null
specifications. Just supply theSpecification
object instead. Typically, this is used inpreprocessSpecification
orpostprocessSpecification
, which have that already anyway. Can useCifScopeUtils.getSpecification
otherwise.
- For the new output:
- I opted to first categorize by sorted message, then by sorted context, and then by sorted line nr.
- All violations (for that message and context) on the same line are reported with the text of that line, and markers that indicate where the violations are within the line.
- Violations reported on the specification have only a message, no context, no lines, no markers.
- Various checks have improvements beyond pure API adaptations:
- Automaton only with one initial location: reports evaluation failures per initialization predicate.
- Component no initialization predicates: report per initialization predicate.
- No specific expressions: no more info than needed in violation messages.
- No specific expressions: specific relevant information in violation messages.
- No specific expressions: some other small improvements.
- No specific binary expressions: no more info than needed in violation messages.
- No specific unary expressions: no more info than needed in violation messages.
- Locations only statically evaluable marker predicates: report violations per marker predicate.
- Other changes:
- Various type checker and position information fixes, to ensure position information on types is from where the type is used, not from where the type is defined or copied from.
- CIF parser: standard library function calls now has position info on the
(
symbol for the function call, and position information on the standard library function reference itself only for the standard library function reference. Previously, both had the position information from the standard library function reference. This makes that we can distinguish between the two. It also makes standard library function calls consistent with other function calls. - Removed some unnecessary super calls from test class constructors.
- Merge request is ready to be reviewed. Probably best to review per commit, as there are quite a few of them, with quite some changes, as the whole checker framework is essentially redesigned. I reworked the commits to hopefully make it easy to review.
- Potential follow-ups:
- Explain the output in the end user documentation, such that users can read how to interpret the output, how to work with, etc.
- Adapt the pretty printer to use a keyword for each line, e.g., for each initialization and marker predicate.
Closes #454 (closed)
Edited by Dennis Hendriks