From 95f6cef603b63b8ab03812900f17f86daad59aad Mon Sep 17 00:00:00 2001 From: Pablissimo Date: Sat, 4 Feb 2017 16:09:40 +0000 Subject: [PATCH] Tidying up a couple of issues --- .../java/com/pablissimo/sonar/TsLintExecutorImpl.java | 2 +- src/main/java/com/pablissimo/sonar/TsLintSensor.java | 10 ++++------ .../java/com/pablissimo/sonar/TypeScriptPlugin.java | 4 ++-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/pablissimo/sonar/TsLintExecutorImpl.java b/src/main/java/com/pablissimo/sonar/TsLintExecutorImpl.java index bba6196..0dd48c9 100644 --- a/src/main/java/com/pablissimo/sonar/TsLintExecutorImpl.java +++ b/src/main/java/com/pablissimo/sonar/TsLintExecutorImpl.java @@ -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 toReturn = new ArrayList(); toReturn.add(this.getFileContent(new File(config.getPathToTsLintOutput()))); return toReturn; diff --git a/src/main/java/com/pablissimo/sonar/TsLintSensor.java b/src/main/java/com/pablissimo/sonar/TsLintSensor.java index 55bdcab..b6cac4b 100644 --- a/src/main/java/com/pablissimo/sonar/TsLintSensor.java +++ b/src/main/java/com/pablissimo/sonar/TsLintSensor.java @@ -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); } @@ -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 diff --git a/src/main/java/com/pablissimo/sonar/TypeScriptPlugin.java b/src/main/java/com/pablissimo/sonar/TypeScriptPlugin.java index 33d48a6..92e2181 100644 --- a/src/main/java/com/pablissimo/sonar/TypeScriptPlugin.java +++ b/src/main/java/com/pablissimo/sonar/TypeScriptPlugin.java @@ -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 )