Skip to content

Commit

Permalink
Fix 2 for #43 and #42
Browse files Browse the repository at this point in the history
  • Loading branch information
Thibault Falque committed Nov 30, 2017
1 parent 5748779 commit adc4e1c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<!-- it's recommended to follow the pattern "sonar-{key}-plugin", for example
"sonar-php-plugin" -->
<artifactId>sonar-golang-plugin</artifactId>
<version>1.2.11-rc5</version>
<version>1.2.11-rc6</version>


<name>Golang</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import javax.xml.stream.XMLStreamException;

import org.apache.commons.lang3.StringUtils;
import org.sonar.api.batch.fs.FilePredicates;
import org.sonar.api.batch.fs.FileSystem;
import org.sonar.api.batch.fs.InputFile;
import org.sonar.api.batch.sensor.Sensor;
Expand Down Expand Up @@ -141,10 +142,10 @@ protected void parseAndSaveResults(final File file) throws XMLStreamException, P

private void getResourceAndSaveIssue(final GoError error) {

InputFile inputFile = fileSystem.inputFile(fileSystem.predicates()
.and(fileSystem.predicates().or(fileSystem.predicates().hasRelativePath(error.getFilePath()),
fileSystem.predicates().hasAbsolutePath(error.getFilePath()),
fileSystem.predicates().hasType(InputFile.Type.MAIN))));
FilePredicates predicates = fileSystem.predicates();

InputFile inputFile = fileSystem.inputFile(
predicates.and(predicates.hasPath(error.getFilePath()), predicates.hasType(InputFile.Type.MAIN)));

GoKeyRule.init();
if (inputFile != null) {
Expand Down

0 comments on commit adc4e1c

Please sign in to comment.