Closed zonArt closed 8 years ago
Is this the sort of thing you are seeing?
file { '/tmp/readme.txt':
ensure => file,
owner => '0', # Noncompliant
group => '0', # Noncompliant
mode => '0644', # Noncompliant
}
Not really no, more something like:
file { '/tmp/readme.txt':
ensure => file, # Noncompliant (because of the three spaces instead of two)
owner => '0', # Noncompliant
group => '0', # Noncompliant
mode => '0644', # Noncompliant
}
All the other lines are well aligned with the first one however they're all wrong because of indentation. Not sure if I'm clear enough sorry
Is 3 indenting something your doing as standard or do you just have some non compliant code?
No it was just a mistake and it's not a problem having an issue raised for it but it's probably not necessary to have 5 issues for the same block. Do you know what I mean ?
Yeah i understand, where your coming. The main concern I have is lets say we have a file with many statements on it, that could potentially all be poorly indented. Like the params on this class. I'd need to make sure the parent issue clearly states all issues on the block below, this could get quite messy.
Let me have a think and i'll see what i can come up with.
I understand the concerns of having each line with it own issue and especially if some of them are correctly indented and some other aren't but we can maybe think about regrouping consecutive lines with the same issue under only one.
I like the idea of doing it with consecutive lines, so you would have something like:
The following x lines should start on column y.
Which in the example above would be issue raised on line 2 (first occurrence) and be for the following 4 lines.
yes exactly
This will be in the next release.
In a resource definition if the whole block below is badly indented, sonar plugin raises one issue per line instead of only one for the whole block. Would be great if this could be merged as one single issue.