bentolor / idea-cli-inspector

A little command-line tool to integrate the awesome IntelliJ IDEA code inspections in your continuous integration (CI) process using Jenkins, Bamboo, et. al.
Apache License 2.0
139 stars 13 forks source link

Colm B - Colons to Equals Sign #19

Closed ColmBhandal closed 6 years ago

ColmBhandal commented 6 years ago

Hi Bentolor,

Thanks for this cool tool! I changed the colons to equals signs because many path names contain colons and splitting on this character was causing the paths to be split, and hence errors.

Another thing I changed was to add the property-value pairs in reverse order in configFile.eachLine{... in ideainspect.groovy, because the values were in as {Val, Name, Val, Name,...} instead of {Name, Val, Name, Val,...}

Maybe it was just on my machine, in which case I suppose pulling this to the main branch doesn't make sense. But maybe you can check it out?

Cheers,

Colm

bentolor commented 6 years ago

Thanks @ColmBhandal for reporting and trying to fix this issues. Indeed I never used a Windows path, so this is clearly a bug.

Because I do not want to change the user-facing API and break things for previous users I rather tried to fix the original bug rather than changing the configuration file format. https://github.com/bentolor/idea-cli-inspector/commit/4d8541d948be460e06eb3ecd62ef046e954a3af3 should fix this as it only looks out for the first :.

Another thing I changed was to add the property-value pairs in reverse order in configFile.eachLine{... in ideainspect.groovy, because the values were in as {Val, Name, Val, Name,...} instead of {Name, Val, Name, Val,...}

This is something I cannot reproduce / understand at all. My best tip would be, that due to some mixup in the config file parsing the whole set got offset by one. This change should not be necessary at all.

Can you pleas check if the latest master fixes the issue with your path and as well if now the property-value pairs are correct again. If not, please run idea-cli-inspector with the -v option and quote the output here so I can better understand the issue.

Thanks again for reporting the bug.

ColmBhandal commented 6 years ago

Hey thanks for the reply Bentolor,

Totally makes sense not to pull. No need to worry about the second bug- it's working now on my machine. Maybe it's a Windows thing. Not to worry anyway!

Thanks again for the awesome tool!

Colm

This is the bug I have reported for it on my own notes:

ConfigArgs Parsing

Error message:

ERROR = IntellIJ IDEA Code Analysis Wrapper - v1.6 - @bentolor error: Missing argument for option: sc

accoompanied by:

java.lang.NullPointerException: Cannot get property 'help' on null object

    at ideainspect.parseCli(ideainspect.groovy:219)

    at ideainspect.run(ideainspect.groovy:52)

Fix:

In Bentolor's script, I believe some cmd line args are read from the file .ideainspect. But I believe the groovy script is adding them in the wrong order:

configArgs.push('--' + values[0].trim())
configArgs.push(values[1].trim())

It should be, I believe:

configArgs.push(values[1].trim())
configArgs.push('--' + values[0].trim())