1

Is it possible to set up start and end comments for disabling simian in an Ant task? I've seen various forums talking about a command line option to disable simian for certain blocks of code using comments and I have tried this in the Ant task doing something like this:

<simian ignoreBlocks="simian-start:simian-stop" .... />

And then in the Java code, I have done the following

//simian-start
....
//simian-stop

However, the duplication is still detected between the bit of code between the comments above and the other class that has the same bit of code.

I also tried it the other way around just in case I have the ordering of the ignoreBlocks mixed up:

//simian-stop
....
//simian-start
digiarnie
  • 22,305
  • 31
  • 78
  • 126

1 Answers1

1

I've got it working just like you described. I am using simian 2.2.24. The command line call

java -jar ~/tmp/simian-2.2.24/simian-2.2.24.jar -ignoreBlocks="simian-off:simian-on" test.java

does not find code like this:

//simian-off
foo.bar();
//simian-on

Setting the ignoreBlocks attribute in the ant task the same way

<simian language="java" ignoreBlocks="simian-off:simian-on">
...
</simian>

also does not find the code.

Hth

M A
  • 71,713
  • 13
  • 134
  • 174
neurolabs
  • 542
  • 3
  • 8
  • At first I didn't notice why yours would have worked yet mine didn't. Then I paid closer attention and noticed that the OFF has to come before the ON. My silly mistake. Thanks! – digiarnie Nov 30 '10 at 02:58
  • Just an extra note. I started a new project and got the same issue again. It turns out when I put // simian:off // simian:on it still didn't ignore that block but I had to actually remove the space between the // and the simian part(!!) - just an extra hint just in case someone runs into the problem. – digiarnie Jun 08 '11 at 00:49