#37 Rule identification

release_2.4
closed
None
5
2012-10-10
2002-02-17
No

It would be useful if specific rules for things to be
checked could be identified and then an indication of
the rule passed to an AuditListener in the AuditEvent
object.

I'm working on a checkstyle plugin for the Eclipse
platform and would like to allow the user to assign
severities (e.g. Error, Warning, Info) to each
checkstyle message. To do this I need to define
specific 'rules' checkstyle should enforce and what
the severity of a violation is. The following is a
suggestion of how the rules might be organized in an
XML file:

<category name="Formatting">
<rule id="checkstyle.rulexxx"
name="No lines longer then 80 characters">
<property name="checkstyle.maxlinelen"
value="80"/>
</rule>
<rule>
...
</rule>
</category>

If the rule ID were passed in the AuditEvent then I
could map the violation to a user selected severity
level and display the appropriate indications to the
user.

Discussion

  • Oliver Burn

    Oliver Burn - 2002-02-17

    Logged In: YES
    user_id=218824

    This is an interesting idea. At some stage the
    configuration and reporting of Checkstyle needs to be
    revamped. I'd suggest this happens after a bit more
    functionality gets added when we better understand all the
    checks.

     
  • Lars Kühne

    Lars Kühne - 2002-02-18

    Logged In: YES
    user_id=401384

    I feel that differentiating between warnings and errors is a
    good thing. It is even such a good thing that it should be
    part of the checkstyle core. That way, the feature would be
    available to all front ends, e.g. the ANT task could just
    report warnings but stop the build on errors.

     
  • Oliver Burn

    Oliver Burn - 2002-08-12

    Logged In: YES
    user_id=218824

    I have added support for localization of error messages. So
    what? Well it means that AuditEvent not contains a symbolic
    name for the error message, which is equivalent to the rule.

    Please let us know how you are going with the Eclipse plug-
    in.

    Regards

     

Log in to post a comment.