proper regexp for NLS trailing comments

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

proper regexp for NLS trailing comments

ramfree17
Hi,

  I am using checkstyle version 4.3 and trying to use legalComment attribute of
the Misc/TrailingComment check to exempt all trailing comments for NLS strings
(//$NON-NLS-1$) and have tried to use the following configuration which
(according to eclipse-cs) matches the lines:

        <module name="TrailingComment">
            <property name="severity" value="info"/>
            <property name="legalComment" value=".*//\$NON-NLS.*"/>
        </module>

  I have also tried the following regexp to see if they would work but
to no avail:

   value=".*//\\$NON-NLS.*"
   value=".*//\\\\$NON-NLS.*"
   value=".*//.*NON-NLS-.*"
   value=".*\/\/.*NON-NLS-.*"

  Some pointers on where I messed up is greatly appreciated. Thanks.

ciao!
--

"Programming, an artform that fights back"

Anuerin G. Diaz
Registered Linux User #246176
Friendly Linux Board @ http://mandrivausers.org/index.php
http://capsule.ramfree17.org , when you absolutely have nothing else
better to do

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: proper regexp for NLS trailing comments

ramfree17
Hi,

  Any suggestions? This is still making me tear my hair (whatever is
remaining) out. Thanks.

ciao!

On 6/29/07, Anuerin Diaz <[hidden email]> wrote:

> Hi,
>
>   I am using checkstyle version 4.3 and trying to use legalComment attribute of
> the Misc/TrailingComment check to exempt all trailing comments for NLS strings
> (//$NON-NLS-1$) and have tried to use the following configuration which
> (according to eclipse-cs) matches the lines:
>
>         <module name="TrailingComment">
>             <property name="severity" value="info"/>
>             <property name="legalComment" value=".*//\$NON-NLS.*"/>
>         </module>
>
>   I have also tried the following regexp to see if they would work but
> to no avail:
>
>    value=".*//\\$NON-NLS.*"
>    value=".*//\\\\$NON-NLS.*"
>    value=".*//.*NON-NLS-.*"
>    value=".*\/\/.*NON-NLS-.*"
>
>   Some pointers on where I messed up is greatly appreciated. Thanks.
>
> ciao!
> --
>
> "Programming, an artform that fights back"
>
> Anuerin G. Diaz
> Registered Linux User #246176
> Friendly Linux Board @ http://mandrivausers.org/index.php
> http://capsule.ramfree17.org , when you absolutely have nothing else
> better to do
>


--

"Programming, an artform that fights back"

Anuerin G. Diaz
Registered Linux User #246176
Friendly Linux Board @ http://mandrivausers.org/index.php
http://capsule.ramfree17.org , when you absolutely have nothing else
better to do

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: proper regexp for NLS trailing comments

AngocA
In reply to this post by ramfree17
Hi,

In order to ignore the Externalized String comments generated by eclipse, you could configure Checkstyle in this way:

<module name="TrailingComment">
        <property name="legalComment" value="\$NON-NLS-" />
</module>

Then, you could also ignore the trailing comments generated by PMD.


ramfree17 wrote
Hi,

  I am using checkstyle version 4.3 and trying to use legalComment attribute of
the Misc/TrailingComment check to exempt all trailing comments for NLS strings
(//$NON-NLS-1$) and have tried to use the following configuration which
(according to eclipse-cs) matches the lines:

        <module name="TrailingComment">
            <property name="severity" value="info"/>
            <property name="legalComment" value=".*//\$NON-NLS.*"/>
        </module>

  I have also tried the following regexp to see if they would work but
to no avail:

   value=".*//\\$NON-NLS.*"
   value=".*//\\\\$NON-NLS.*"
   value=".*//.*NON-NLS-.*"
   value=".*\/\/.*NON-NLS-.*"

  Some pointers on where I messed up is greatly appreciated. Thanks.

ciao!
--

"Programming, an artform that fights back"

Anuerin G. Diaz
Registered Linux User #246176
Friendly Linux Board @ http://mandrivausers.org/index.php
http://capsule.ramfree17.org , when you absolutely have nothing else
better to do

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Checkstyle-user mailing list
Checkstyle-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/checkstyle-user