checkstyle / eclipse-cs

The Eclipse Checkstyle plug-in integrates the Checkstyle Java code auditor into the Eclipse IDE. The plug-in provides real-time feedback to the user about violations of rules that check for coding style and possible error prone code constructs.
https://checkstyle.org/eclipse-cs
GNU Lesser General Public License v2.1
97 stars 56 forks source link

Validate checkstyle-configuration-xml after plugin-update... #204

Open AlBundy33 opened 4 years ago

AlBundy33 commented 4 years ago

... 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

Bananeweizen commented 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.

lkoe commented 4 years ago

I would rather suggest to get rid of the problem...

Excellent analysis and I fully agree that this would be the best way forward.