SourceForge has been redesigned. Learn more.
Close

#365 choosable properties file pattern

release_3.4
closed
5
2012-10-10
2005-06-28
No

This request applys to the translation module of
checkstyle.

Our source code has also properties files that are not
used for locale settings (labels, messages,...). These
other properties files are
called "xxx_properties.properties" and contain some
external constants like for example field lenghts. Setting
a parameter for properties filename patterns that shoud
be ignored by checkstyle's translation module would be
a very useful feature. One could configure the translation
as follows:
<module name="Translation" exclude-="" patterns="*_properties.properties"/>
or for more patterns
<module name="Translation" exclude-="" patterns="pattern1.properties, pattern2.properties, ... patternX.properties"/>

Discussion

  • Eduard Weber IT Solutions

    Logged In: YES
    user_id=1304097

    Of course the configuration examples I've wrote are wrong.
    The correct ones would be:
    <module name="Translation">
    <property name="pattern" value="*_properties.properties"/>
    </module>
    and for more patterns
    <module name="Translation">
    <property name="pattern" value="pattern1.properties, pattern2.properties, ... patternX.properties"/>
    </module>

     
  • Oleg Sukhodolsky

    Logged In: YES
    user_id=746148

    as far as I can see Translation check is a fileset check,
    i.e. it gets
    set of files and checks them. The functionality you
    requested may be
    achieved by reducing file set which this check should process.
    Is this enough for you, or I missed something?

     
  • Eduard Weber IT Solutions

    Logged In: YES
    user_id=1304097

    Did you realy ment I should remove the files I don't want to
    check from my project directory before starting the report or
    did you ment any other possibility to set the patterns of files
    to be checked in a configuration file? The latest is what I've
    suggested to enhance, because the actual module allows
    only the call:
    <module name="Translation"/> without possibility to set any
    other property. It would be nice if it worked analog to
    NewlineAtEndOfFile, where one can set the considered file
    extensions. It is realy easier to configure the behaviour of the
    reporting tool than copy the project manualy to other
    locations and than delete manualy not desired files. It would
    be realy logical to get the project directory as is and do the
    report as configured? Isn't that the right purpose of
    configuration files.

     
  • Lars Kühne

    Lars Kühne - 2005-06-30

    Logged In: YES
    user_id=401384

    Oleg didn't mean that you should pysically move files around
    on your hard drive.

    Technically Translation supports filtering by file
    extensions as well, but that's not documented because it
    only make sense for .properties files.

    It's not possible to specify arbitrary filesets in the
    module definition and I'm not sure whether it makes sense to
    add the whole Ant fileset machinery to Checkstyle.

    However if you are using Ant, it is possible to exclude your
    files in the fileset you pass to the checkstyle task, and
    that's what oleg probably meant. Please let us know if this
    is sufficient or if you really need this on the checkstyle
    module level.

     
  • Oleg Sukhodolsky

    Logged In: YES
    user_id=746148

    Lars is right I meant that you can filter files in ant script.

     

Log in to post a comment.