Skip to content

Commit

Permalink
Merge branch 'release/V2.30.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
gquerret committed Jan 2, 2025
2 parents 59b1262 + 75fc647 commit bad54c5
Show file tree
Hide file tree
Showing 52 changed files with 758 additions and 365 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pipeline {
} else if (env.BRANCH_NAME.startsWith("release") || env.BRANCH_NAME.startsWith("hotfix")) {
sh "$MVN_HOME/bin/mvn clean javadoc:javadoc install -Dmaven.test.failure.ignore=true -Dgit.commit=\$(git rev-parse --short HEAD)"
} else {
sh "$MVN_HOME/bin/mvn clean package -Dmaven.test.failure.ignore=true -Dgit.commit=\$(git rev-parse --short HEAD)"
sh "$MVN_HOME/bin/mvn clean verify -Dmaven.test.failure.ignore=true -Dgit.commit=\$(git rev-parse --short HEAD)"
}
}
}
Expand Down
16 changes: 8 additions & 8 deletions coverage-report/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>eu.rssw</groupId>
<artifactId>sonar-openedge</artifactId>
<version>2.29.1</version>
<version>2.30.0</version>
</parent>
<groupId>eu.rssw.openedge.parsers</groupId>
<artifactId>coverage-report</artifactId>
Expand All @@ -21,37 +21,37 @@
<dependency>
<groupId>eu.rssw.openedge.rcode</groupId>
<artifactId>rcode-reader</artifactId>
<version>2.29.1</version>
<version>2.30.0</version>
</dependency>
<dependency>
<groupId>eu.rssw.sonar.openedge</groupId>
<artifactId>sonar-openedge-plugin</artifactId>
<version>2.29.1</version>
<version>2.30.0</version>
</dependency>
<dependency>
<groupId>eu.rssw.openedge.parsers</groupId>
<artifactId>proparse</artifactId>
<version>2.29.1</version>
<version>2.30.0</version>
</dependency>
<dependency>
<groupId>eu.rssw.openedge.parsers</groupId>
<artifactId>profiler-parser</artifactId>
<version>2.29.1</version>
<version>2.30.0</version>
</dependency>
<dependency>
<groupId>eu.rssw.openedge.parsers</groupId>
<artifactId>database-parser</artifactId>
<version>2.29.1</version>
<version>2.30.0</version>
</dependency>
<dependency>
<groupId>eu.rssw.openedge.parsers</groupId>
<artifactId>listing-parser</artifactId>
<version>2.29.1</version>
<version>2.30.0</version>
</dependency>
<dependency>
<groupId>eu.rssw.openedge.checks</groupId>
<artifactId>openedge-checks</artifactId>
<version>2.29.1</version>
<version>2.30.0</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion database-parser/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>eu.rssw</groupId>
<artifactId>sonar-openedge</artifactId>
<version>2.29.1</version>
<version>2.30.0</version>
</parent>
<groupId>eu.rssw.openedge.parsers</groupId>
<artifactId>database-parser</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion listing-parser/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>eu.rssw</groupId>
<artifactId>sonar-openedge</artifactId>
<version>2.29.1</version>
<version>2.30.0</version>
</parent>
<groupId>eu.rssw.openedge.parsers</groupId>
<artifactId>listing-parser</artifactId>
Expand Down
6 changes: 3 additions & 3 deletions openedge-checks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>eu.rssw</groupId>
<artifactId>sonar-openedge</artifactId>
<version>2.29.1</version>
<version>2.30.0</version>
</parent>
<groupId>eu.rssw.openedge.checks</groupId>
<artifactId>openedge-checks</artifactId>
Expand All @@ -23,12 +23,12 @@
<dependency>
<groupId>eu.rssw.openedge.parsers</groupId>
<artifactId>database-parser</artifactId>
<version>2.29.1</version>
<version>2.30.0</version>
</dependency>
<dependency>
<groupId>eu.rssw.openedge.parsers</groupId>
<artifactId>proparse</artifactId>
<version>2.29.1</version>
<version>2.30.0</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ protected NewIssue createIssue(InputFile file, ProToken token, String msg, boole
NewIssueLocation location = issue.newLocation().on(targetFile);
if (lineNumber > 0) {
if (exactLocation) {
location.at(targetFile.newRange(token.getLine(), token.getCharPositionInLine() - 1, token.getEndLine(),
location.at(targetFile.newRange(token.getLine(), token.getCharPositionInLine(), token.getEndLine(),
token.getEndCharPositionInLine()));
} else {
TextRange range = targetFile.selectLine(lineNumber);
Expand Down Expand Up @@ -168,7 +168,7 @@ protected void addLocation(NewIssue issue, InputFile file, JPNode node, String m
int lineNumber = naturalChild.getLine();
if (lineNumber > 0) {
if (exactLocation) {
location.at(targetFile.newRange(naturalChild.getLine(), naturalChild.getColumn() - 1,
location.at(targetFile.newRange(naturalChild.getLine(), naturalChild.getColumn(),
naturalChild.getEndLine(), naturalChild.getEndColumn()));
} else {
TextRange range = targetFile.selectLine(lineNumber);
Expand Down
8 changes: 4 additions & 4 deletions openedge-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>eu.rssw</groupId>
<artifactId>sonar-openedge</artifactId>
<version>2.29.1</version>
<version>2.30.0</version>
</parent>
<groupId>eu.rssw.sonar.openedge</groupId>
<artifactId>sonar-openedge-plugin</artifactId>
Expand All @@ -30,17 +30,17 @@
<dependency>
<groupId>eu.rssw.openedge.checks</groupId>
<artifactId>openedge-checks</artifactId>
<version>2.29.1</version>
<version>2.30.0</version>
</dependency>
<dependency>
<groupId>eu.rssw.openedge.parsers</groupId>
<artifactId>listing-parser</artifactId>
<version>2.29.1</version>
<version>2.30.0</version>
</dependency>
<dependency>
<groupId>eu.rssw.openedge.parsers</groupId>
<artifactId>profiler-parser</artifactId>
<version>2.29.1</version>
<version>2.30.0</version>
</dependency>
<dependency>
<groupId>org.sonarsource.sonarqube</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,8 @@ public void define(Context context) {
context.addExtensions(OpenEdge.class, OpenEdgeDB.class, OpenEdgeSettings.class);

// Profile and rules
if (context.getRuntime().getProduct() == SonarProduct.SONARQUBE)
context.addExtension(OpenEdgeRulesDefinition.class);

context.addExtensions(BasicChecksRegistration.class, OpenEdgeProfile.class, OpenEdgeDBProfile.class,
OpenEdgeMetrics.class, OpenEdgeComponents.class);
context.addExtensions(OpenEdgeRulesDefinition.class, BasicChecksRegistration.class, OpenEdgeProfile.class,
OpenEdgeDBProfile.class, OpenEdgeMetrics.class, OpenEdgeComponents.class);

// Syntax highlight and simple CPD
if (context.getRuntime().getProduct() == SonarProduct.SONARQUBE) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private void visitCpdNode(JPNode node) {
}

try {
TextRange range = file.newRange(node.getLine(), node.getColumn() - 1, node.getEndLine(), node.getEndColumn());
TextRange range = file.newRange(node.getLine(), node.getColumn(), node.getEndLine(), node.getEndColumn());
cpdTokens.addToken(range, str);
} catch (IllegalArgumentException | IllegalStateException uncaught) {
LOG.debug("Unable to create CPD token at position {}:{} to {}:{} - Cause {}", node.getLine(), node.getColumn(),
Expand All @@ -143,7 +143,7 @@ private void insertFakeNode(JPNode node) {
List<JPNode> children = node.getDirectChildren();
JPNode lastSibling = children.isEmpty() ? node : children.get(children.size() - 1);
try {
TextRange range = file.newRange(node.getLine(), node.getColumn() - 1, lastSibling.getEndLine(), lastSibling.getEndColumn() - 1);
TextRange range = file.newRange(node.getLine(), node.getColumn(), lastSibling.getEndLine(), lastSibling.getEndColumn());
cpdTokens.addToken(range, UUID.randomUUID().toString());
} catch (IllegalArgumentException | IllegalStateException uncaught) {
LOG.debug("Unable to create CPD token at position {}:{} to {}:{} - Cause {}", node.getLine(), node.getColumn(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private static void processToken(InputFile file, NewCpdTokens cpdTokens, ProToke
}

try {
TextRange range = file.newRange(tok.getLine(), tok.getCharPositionInLine() - 1, tok.getEndLine(),
TextRange range = file.newRange(tok.getLine(), tok.getCharPositionInLine(), tok.getEndLine(),
tok.getEndCharPositionInLine());
cpdTokens.addToken(range, str);
} catch (IllegalArgumentException | IllegalStateException uncaught) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private void highlightFile(SensorContext context, IProparseEnvironment session,

if (textType != null) {
try {
TextPointer start = file.newPointer(tok.getLine(), tok.getCharPositionInLine() - 1);
TextPointer start = file.newPointer(tok.getLine(), tok.getCharPositionInLine());
int maxChar = file.selectLine(tok.getEndLine()).end().lineOffset();
TextPointer end = file.newPointer(tok.getEndLine(), maxChar < tok.getEndCharPositionInLine()
? (maxChar > 0 ? maxChar - 1 : 0) : tok.getEndCharPositionInLine());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,8 @@ private void parseMainFile(SensorContext context, InputFile file, IProparseEnvir
TextPointer end = null;
if (InputFileUtils.getRelativePath(file, context.fileSystem()).equals(tok.getFileName())) {
try {
strt = file.newPointer(tok.getLine(), tok.getCharPositionInLine() - 1);
end = file.newPointer(tok.getLine(), tok.getCharPositionInLine());
strt = file.newPointer(tok.getLine(), tok.getCharPositionInLine());
end = file.newPointer(tok.getLine(), tok.getEndCharPositionInLine());
} catch (IllegalArgumentException uncaught) {
// Nothing
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class OpenEdgePluginTest {
public void testExtensionsSonarLint() {
Plugin.Context context = new Plugin.Context(SONARLINT_RUNTIME);
new OpenEdgePlugin().define(context);
assertEquals(context.getExtensions().size(), 26);
assertEquals(context.getExtensions().size(), 27);
}

@Test
Expand Down
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>eu.rssw</groupId>
<artifactId>sonar-openedge</artifactId>
<version>2.29.1</version>
<version>2.30.0</version>
<packaging>pom</packaging>

<name>OpenEdge plugin for SonarQube</name>
Expand Down
2 changes: 1 addition & 1 deletion profiler-parser/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>eu.rssw</groupId>
<artifactId>sonar-openedge</artifactId>
<version>2.29.1</version>
<version>2.30.0</version>
</parent>
<groupId>eu.rssw.openedge.parsers</groupId>
<artifactId>profiler-parser</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions proparse/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>eu.rssw</groupId>
<artifactId>sonar-openedge</artifactId>
<version>2.29.1</version>
<version>2.30.0</version>
</parent>
<groupId>eu.rssw.openedge.parsers</groupId>
<artifactId>proparse</artifactId>
Expand All @@ -22,7 +22,7 @@
<dependency>
<groupId>eu.rssw.openedge.rcode</groupId>
<artifactId>rcode-reader</artifactId>
<version>2.29.1</version>
<version>2.30.0</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,10 @@ widgetname:
identifier
;

queryIdentifier:
identifier
;

identifier:
// identifier gets us an ID node for an unqualified (local) reference.
// Only an ID or unreservedkeyword can be used as an unqualified reference.
Expand Down Expand Up @@ -1173,7 +1177,7 @@ clearStatement:
;

closeQueryStatement:
CLOSE QUERY identifier statementEnd
CLOSE QUERY queryIdentifier statementEnd
;

closeStoredProcedureStatement:
Expand Down Expand Up @@ -1851,12 +1855,12 @@ definePropertyAccessorSetBlock:

defineQueryStatement:
DEFINE defineShare? ( PRIVATE | PROTECTED | STATIC )*
QUERY n=identifier
QUERY id=identifier
FOR record recordFields?
( COMMA record recordFields? )*
( cacheExpr | SCROLLING | RCODEINFORMATION )*
statementEnd
{ support.defVar($n.text); }
{ support.defVar($id.text); }
;

defineRectangleStatement:
Expand Down Expand Up @@ -2514,7 +2518,7 @@ externalFunctionStatement:
;

getStatement:
GET findWhich identifier ( lockHow | NOWAIT )* statementEnd
GET findWhich queryIdentifier ( lockHow | NOWAIT )* statementEnd
;

getKeyValueStatement:
Expand Down Expand Up @@ -2960,7 +2964,7 @@ onAction:
;

openQueryStatement:
OPEN QUERY identifier ( FOR | PRESELECT ) multiRecordSearch
OPEN QUERY queryIdentifier ( FOR | PRESELECT ) multiRecordSearch
openQueryOption*
statementEnd
;
Expand Down Expand Up @@ -3268,7 +3272,7 @@ releaseObjectStatement:
;

repositionStatement:
REPOSITION identifier repositionOption NOERROR? statementEnd
REPOSITION queryIdentifier repositionOption NOERROR? statementEnd
;

repositionOption:
Expand Down
30 changes: 0 additions & 30 deletions proparse/src/main/java/org/prorefactor/core/Pair.java

This file was deleted.

10 changes: 1 addition & 9 deletions proparse/src/main/java/org/prorefactor/core/ProToken.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,6 @@ public int getLine() {
return line;
}

/**
* The index of the first character of this token relative to the beginning of the line at which it occurs.
*
* IMPORTANT: While the ANTLR4 Token interface specifies that charPositionInLine should start at 0, the ProToken
* implementation starts at 1. This implementation detail might change in the future (if that's not too late).
*/
@Override
public int getCharPositionInLine() {
return charPositionInLine;
Expand Down Expand Up @@ -150,9 +144,7 @@ public int getEndLine() {
}

/**
* The index of the last character of this token relative to the beginning of the line at which it occurs. This means
* that the first character of next token will be at this position + 1. Also means that getCharPositionInLine() ==
* getEndCharPositionInLine() for single-character tokens.
* Line offset **after** the last character of the token
*/
public int getEndCharPositionInLine() {
return endCharPositionInLine;
Expand Down
Loading

0 comments on commit bad54c5

Please sign in to comment.