Re: [Codenarc-user] Illegal Regex Ignore String and Comments
Brought to you by:
chrismair
From: <chr...@we...> - 2014-11-03 22:10:32
|
>> Is there a way to make the rule ignore strings and comments? Unfortunately, no. That rule applies to the source text of the entire file, so it is not smart enough to understand context, unless you can encode that context within the regex. From: Eric Wehrmeister [mailto:eri...@gm...] Sent: Monday, November 03, 2014 4:19 PM To: cod...@li... Subject: [Codenarc-user] Illegal Regex Ignore String and Comments Hi, I'm using the Illegal Regex rule to disallow a few specific things in my groovy code. Is there a way to make the rule ignore strings and comments? For exemple, I want any question marks to be preceded by a space, but I'd like to not cause a violation if this occurs in a string or a comment (especially since strings may contain URIs with parameters specified using question marks) Thanks, Eric Wehrmeister |