Open AlBundy33 opened 4 years ago
I would rather suggest to get rid of the problem in the checkstyle configuration, independent of the eclipse plugin. Right now the configuration file XML tag nesting must fit the checker class hierarchy nesting, and the XML attributes must fit the class fields, or else all hell breaks loose. To my mind it should be possible to use an XML parser that can parse the config as it is into a simple key-value model, independent of the current class hierarchy and field declarations of checkstyle core. When configuring a checker, it should then lookup the configuration values that have been parsed, use them, and log a warning for all missing/wrong fields/classes in the configuration. Right now, the checkstyle configuration format is basically a hardcoded serialization of the internal implementation model. And that is generally a bad idea, if you want to be able to change the internal model all the time, but want to be upwards compatible with your configuration file.
I would rather suggest to get rid of the problem...
Excellent analysis and I fully agree that this would be the best way forward.
... and show error if there is something wrong with the xml.
E.g. schema error, removed Checker, old attributes, ...
And maybe display releasenotes after an update especially if there are new configuration that break backwards compatibility.
See checkstyle/checkstyle#7484