#136 Warn about duplicate modules that don't make sense


I suggest to add warnings if a module is used twice in
the configfile and it makes no sense that this module
is used twice.

For instance, imagine:
<!-- ... -->
<module name="Checker">
<!-- ... -->
<module name="TreeWalker">
<!-- ... -->
<module name="ConstantName" />
<!-- ... -->
<module name="ConstantName">
<property name="format"
value="^(A-Z*|revision)$" />
<!-- ... -->
<!-- ... -->
<!-- ... -->

It makes no sense for module ConstantName to be used
twice. The first module reference will take precedence
over the second one.
This might be confusing for some users not already
experienced with the new xml based config file format.

So I suggest that modules know wether they may be used
just once or several times and warn if they are used
more than once.

Thanks, bye


  • Lars Kühne

    Lars Kühne - 2003-01-26

    Logged In: YES

    I agree that this would prevent configuration errors, and
    implementing this is easy now but might restrict our future
    ability to add other cool features:

    For example I have a feature in mind (no rfe filed yet)
    where the user can add file filters to individual checks. In
    your case it's not so easy to figure out whether using the
    module twice "makes sense".

    Example: Only the files in the public api may have a revision:

    <module name="ConstantName" filter="/api/.java">
    <property name="format"
    |revision)$" />
    <module name="ConstantName" filter="

    As soon as the filter feature is introduced it will be
    pretty hard to find out whether the two modules make sense
    together or not, it depends on the overlap of the filter

    I'd suggest we wait with the implementation until more users
    report the same usabilty problems.

  • Oliver Burn

    Oliver Burn - 2003-02-02

    Logged In: YES

    I do not think it is possible to reliably detect if a module
    can be declared multiple times. I understand the problem
    this presents as it makes is harder to get the config file


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks