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

Commit

Permalink
Fix #103 - specify bug and vuln types against applicable rules (#109)
Browse files Browse the repository at this point in the history
* Update rules to match most recent tslint
* Adding debtTypes to rules
  • Loading branch information
Pablissimo authored Feb 11, 2017
1 parent 18acd35 commit b5f620d
Show file tree
Hide file tree
Showing 7 changed files with 258 additions and 21 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>com.pablissimo.sonar</groupId>
<artifactId>sonar-typescript-plugin</artifactId>
<packaging>sonar-plugin</packaging>
<version>1.0.0-RC1</version>
<version>1.0.0-RC2</version>

<name>TypeScript</name>
<description>Analyse TypeScript projects</description>
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/pablissimo/sonar/TsLintExecutorImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ else if (files == null) {
LOG.debug("Split " + files.size() + " files into " + batches.size() + " batches for processing");

for (int i = 0; i < batches.size(); i++) {
StringBuilder outputBuilder = new StringBuilder();

List<String> thisBatch = batches.get(i);

Command thisCommand = getBaseCommand(config, tslintOutputFilePath);
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/com/pablissimo/sonar/TsLintParserImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
import com.pablissimo.sonar.model.TsLintIssue;

@BatchSide
public class TsLintParserImpl implements TsLintParser {
private static final Logger LOG = LoggerFactory.getLogger(TsLintParserImpl.class);

public class TsLintParserImpl implements TsLintParser {
public Map<String, List<TsLintIssue>> parse(List<String> toParse) {
GsonBuilder builder = new GsonBuilder();
Gson gson = builder.create();
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/com/pablissimo/sonar/TsLintSensor.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,11 @@
import org.sonar.api.batch.sensor.SensorDescriptor;
import org.sonar.api.batch.sensor.issue.NewIssue;
import org.sonar.api.batch.sensor.issue.NewIssueLocation;
import org.sonar.api.batch.fs.FileSystem;
import org.sonar.api.batch.fs.InputFile;
import org.sonar.api.config.Settings;
import org.sonar.api.rule.RuleKey;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;

public class TsLintSensor implements Sensor {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/pablissimo/sonar/TsRulesDefinition.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public static void loadRules(InputStream stream, List<TsLintRule> rulesCollectio
ruleDescription
);
}

rulesCollection.add(tsRule);
}

Expand Down Expand Up @@ -203,7 +203,7 @@ public void define(Context context) {
for (TsLintRule customRule : tslintRules) {
createRule(repository, customRule);
}

repository.done();
}

Expand Down
Loading

0 comments on commit b5f620d

Please sign in to comment.