Skip to content

Commit adc4e1c

Browse files
author
Thibault Falque
committed
Fix 2 for #43 and #42
1 parent 5748779 commit adc4e1c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<!-- it's recommended to follow the pattern "sonar-{key}-plugin", for example
1919
"sonar-php-plugin" -->
2020
<artifactId>sonar-golang-plugin</artifactId>
21-
<version>1.2.11-rc5</version>
21+
<version>1.2.11-rc6</version>
2222

2323

2424
<name>Golang</name>

src/main/java/fr/univartois/sonargo/core/rules/GoLintIssueLoaderSensor.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import javax.xml.stream.XMLStreamException;
3535

3636
import org.apache.commons.lang3.StringUtils;
37+
import org.sonar.api.batch.fs.FilePredicates;
3738
import org.sonar.api.batch.fs.FileSystem;
3839
import org.sonar.api.batch.fs.InputFile;
3940
import org.sonar.api.batch.sensor.Sensor;
@@ -141,10 +142,10 @@ protected void parseAndSaveResults(final File file) throws XMLStreamException, P
141142

142143
private void getResourceAndSaveIssue(final GoError error) {
143144

144-
InputFile inputFile = fileSystem.inputFile(fileSystem.predicates()
145-
.and(fileSystem.predicates().or(fileSystem.predicates().hasRelativePath(error.getFilePath()),
146-
fileSystem.predicates().hasAbsolutePath(error.getFilePath()),
147-
fileSystem.predicates().hasType(InputFile.Type.MAIN))));
145+
FilePredicates predicates = fileSystem.predicates();
146+
147+
InputFile inputFile = fileSystem.inputFile(
148+
predicates.and(predicates.hasPath(error.getFilePath()), predicates.hasType(InputFile.Type.MAIN)));
148149

149150
GoKeyRule.init();
150151
if (inputFile != null) {

0 commit comments

Comments
 (0)