Create CIF linter tool to check for potential modeling mistakes
We already check for various modeling mistakes, and produce warnings, in the type checker. However, some checks can lead to too many false positives. In such cases a separate linting tool could be useful. We discussed this as part of issue #105 (closed) already.
Checks to consider:
- Switch case where a the switch control value and case value are compatible ignoring ranges, but have no overlap in values. See #105 (closed). And similarly for binary comparison operators,
=
,<
, etc. - Unused objects, beyond what the type checker already indicates.
We should make it easy to add more checks in the future.
Things to decide:
- Do we want to also report the warnings reported by the type checker, or omit those?
- How to report the potential issues to users? As a list on the command line? As a parsable JSON output? As an HTML file resembling how CIF models look in the text editor, annotated with the warnings? Some other way?
- How to make it configurable what types of problems (not) to check for?
- Name of the command line tool. Maybe
ciflint
?