Skip to content
This repository has been archived by the owner on Jul 8, 2019. It is now read-only.

Commit

Permalink
Tidying up a couple of issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablissimo committed Feb 4, 2017
1 parent 40b65ea commit 95f6cef
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/pablissimo/sonar/TsLintExecutorImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ else if (files == null) {
}

if (config.useAlreadyExistsTsLintOutput()) {
LOG.debug("Running with exists JSON file");
LOG.debug("Running with existing JSON file '" + config.getPathToTsLintOutput() + "' instead of calling tslint");
List<String> toReturn = new ArrayList<String>();
toReturn.add(this.getFileContent(new File(config.getPathToTsLintOutput())));
return toReturn;
Expand Down
10 changes: 4 additions & 6 deletions src/main/java/com/pablissimo/sonar/TsLintSensor.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ else if (config.getConfigFile() == null && config.getPathToTsConfig() == null) {
continue;
}

String pathAdjusted = file.absolutePath().replace('\\', '/').toLowerCase();
String pathAdjusted = file.absolutePath().replace('\\', '/');
paths.add(pathAdjusted);
fileMap.put(pathAdjusted, file);
}
Expand All @@ -94,14 +94,12 @@ else if (config.getConfigFile() == null && config.getPathToTsConfig() == null) {
continue;
}

String lowerFilePath = filePath.toLowerCase();

if (!fileMap.containsKey(lowerFilePath)) {
LOG.warn("TsLint reported issues against a file that wasn't sent to it - will be ignored: " + lowerFilePath);
if (!fileMap.containsKey(filePath)) {
LOG.warn("TsLint reported issues against a file that wasn't sent to it - will be ignored: " + filePath);
continue;
}

InputFile file = fileMap.get(lowerFilePath);
InputFile file = fileMap.get(filePath);

for (TsLintIssue issue : batchIssues) {
// Make sure the rule we're violating is one we recognise - if not, we'll
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/pablissimo/sonar/TypeScriptPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@
key = TypeScriptPlugin.SETTING_TS_LINT_OUTPUT_PATH,
defaultValue = "",
type = PropertyType.STRING,
name = "Path to TSLint Json output file, if required",
description = "Required if TSLint running before SonarQube checks",
name = "Path to TSLint JSON output file",
description = "If set, the contents of this file will be used to discover linting issues rather than the plugin running tslint itself",
project = true,
global = false
)
Expand Down

0 comments on commit 95f6cef

Please sign in to comment.