Skip to content

Commit

Permalink
#271 move to sonarqube 5.6 LTS
Browse files Browse the repository at this point in the history
  • Loading branch information
iwarapter committed May 15, 2017
1 parent 1604396 commit dde4733
Show file tree
Hide file tree
Showing 33 changed files with 632 additions and 928 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sonar-puppet-plugin/build/libs/*-javadoc.jar
sonar-puppet-plugin/build/libs/*-sources.jar
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM sonarqube:5.6.6-alpine

COPY sonar-puppet-plugin/build/libs/* /opt/sonarqube/extensions/plugins/
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ subprojects {
}

ext {
sonarVersion = '4.5.2'
sslrVersion = '1.20'
sonarVersion = '5.6.6'
sslrVersion = '1.21'
}

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions gradle/sonar.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}
}
dependencies {
classpath "org.sonarqube.gradle:gradle-sonarqube-plugin:1.1"
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.4"
}
}

Expand All @@ -14,7 +14,7 @@ apply plugin: org.sonarqube.gradle.SonarQubePlugin

sonarqube {
properties {
property "sonar.host.url", "http://nemo.sonarqube.org/"
property "sonar.host.url", "https://sonarqube.com/"
property "sonar.analysis.mode", "issues"
property "sonar.issuesReport.console.enable", "true"
property "sonar.issuesReport.html.enable", "true"
Expand Down
2 changes: 0 additions & 2 deletions puppet-checks/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
dependencies {
compile project(':puppet-squid')

testCompile "org.codehaus.sonar:sonar-deprecated:$sonarVersion"

testRuntime 'org.slf4j:slf4j-simple:1.7.12'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public void visitNode(AstNode node) {
node.getDescendants(PuppetGrammar.BOOL_OPERATOR).size() - max,
max),
(double) node.getDescendants(PuppetGrammar.BOOL_OPERATOR).size() - max);

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
package com.iadams.sonarqube.puppet.checks;

import com.iadams.sonarqube.puppet.PuppetCheckVisitor;
import com.sonar.sslr.api.AstNode;
import org.sonar.api.server.rule.RulesDefinition;
import org.sonar.check.Priority;
import org.sonar.check.Rule;
Expand All @@ -43,5 +44,4 @@
public class TestsDirectoryPresentCheck extends PuppetCheckVisitor {

public static final String RULE_KEY = "TestsDirectoryPresent";

}
8 changes: 4 additions & 4 deletions puppet-squid/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dependencies {
compile "org.codehaus.sonar:sonar-plugin-api:$sonarVersion"
compile "org.codehaus.sonar.sslr:sslr-core:$sslrVersion"
compile 'org.codehaus.sonar.sslr-squid-bridge:sslr-squid-bridge:2.6'
compile "org.sonarsource.sonarqube:sonar-plugin-api:$sonarVersion"
compile "org.sonarsource.sslr:sslr-core:$sslrVersion"
compile 'org.sonarsource.sslr-squid-bridge:sslr-squid-bridge:2.6.1'

testCompile "org.codehaus.sonar.sslr:sslr-testing-harness:$sslrVersion"
testCompile "org.sonarsource.sslr:sslr-testing-harness:$sslrVersion"
testCompile 'org.apache.maven:maven-project:2.2.1'

testRuntime 'org.slf4j:slf4j-simple:1.7.12'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* SonarQube Puppet Plugin
* The MIT License (MIT)
*
Expand All @@ -22,13 +22,47 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.iadams.sonarqube.puppet.colorizer;
package com.iadams.sonarqube.puppet;

import org.sonar.colorizer.InlineDocTokenizer;
import com.sonar.sslr.api.Token;

public class PuppetDocTokenizer extends InlineDocTokenizer {
public class TokenLocation {

public PuppetDocTokenizer(String tagBefore, String tagAfter) {
super("#", tagBefore, tagAfter);
private final int startLine;
private final int startLineOffset;
private final int endLine;
private final int endLineOffset;

public TokenLocation(Token token) {
this.startLine = token.getLine();
this.startLineOffset = token.getColumn();

String value = token.getValue();
String[] lines = value.split("\r\n|\n|\r", -1);

if (lines.length > 1) {
endLine = token.getLine() + lines.length - 1;
endLineOffset = lines[lines.length - 1].length();

} else {
this.endLine = this.startLine;
this.endLineOffset = this.startLineOffset + token.getValue().length();
}
}

public int startLine() {
return startLine;
}

public int startLineOffset() {
return startLineOffset;
}

public int endLine() {
return endLine;
}

public int endLineOffset() {
return endLineOffset;
}
}

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit dde4733

Please sign in to comment.