From 92c5dfd8a6ffc678008bd730c543530792e8baae Mon Sep 17 00:00:00 2001 From: Steven Looman Date: Sun, 22 Sep 2019 20:57:05 +0200 Subject: [PATCH 1/5] Continuing development --- CHANGES.md | 3 +++ magik-checks/pom.xml | 2 +- magik-lint/pom.xml | 2 +- magik-squid/pom.xml | 2 +- pom.xml | 2 +- sonar-magik-plugin/pom.xml | 2 +- sslr-magik-toolkit/pom.xml | 2 +- 7 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 964f523e..f8a9a37d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,9 @@ Changes ======= +0.3.2 (unreleased) + + 0.3.1 (2019-09-22) - Prevent CPD errors when SYNTAX\_ERROR token is too long diff --git a/magik-checks/pom.xml b/magik-checks/pom.xml index 68e49d9b..9fa2b2ab 100644 --- a/magik-checks/pom.xml +++ b/magik-checks/pom.xml @@ -6,7 +6,7 @@ org.stevenlooman.sw.sonar sonar-magik - 0.3.1 + 0.3.2-SNAPSHOT magik-checks diff --git a/magik-lint/pom.xml b/magik-lint/pom.xml index ddbf8c04..683d7547 100644 --- a/magik-lint/pom.xml +++ b/magik-lint/pom.xml @@ -6,7 +6,7 @@ org.stevenlooman.sw.sonar sonar-magik - 0.3.1 + 0.3.2-SNAPSHOT magik-lint diff --git a/magik-squid/pom.xml b/magik-squid/pom.xml index 2f17f3cb..07c4295c 100644 --- a/magik-squid/pom.xml +++ b/magik-squid/pom.xml @@ -6,7 +6,7 @@ org.stevenlooman.sw.sonar sonar-magik - 0.3.1 + 0.3.2-SNAPSHOT magik-squid diff --git a/pom.xml b/pom.xml index 001e3a54..295fb312 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 org.stevenlooman.sw.sonar sonar-magik - 0.3.1 + 0.3.2-SNAPSHOT pom Magik diff --git a/sonar-magik-plugin/pom.xml b/sonar-magik-plugin/pom.xml index e78f14df..9212b242 100644 --- a/sonar-magik-plugin/pom.xml +++ b/sonar-magik-plugin/pom.xml @@ -6,7 +6,7 @@ org.stevenlooman.sw.sonar sonar-magik - 0.3.1 + 0.3.2-SNAPSHOT sonar-magik-plugin diff --git a/sslr-magik-toolkit/pom.xml b/sslr-magik-toolkit/pom.xml index 6927fb0a..108b20d9 100644 --- a/sslr-magik-toolkit/pom.xml +++ b/sslr-magik-toolkit/pom.xml @@ -6,7 +6,7 @@ org.stevenlooman.sw.sonar sonar-magik - 0.3.1 + 0.3.2-SNAPSHOT sslr-magik-toolkit From 4928060995b09f4ab3b66e902da6dec33a22a301 Mon Sep 17 00:00:00 2001 From: Steven Looman Date: Wed, 2 Oct 2019 20:41:50 +0200 Subject: [PATCH 2/5] Add check ScopeCount --- CHANGES.md | 2 + .../org/stevenlooman/sw/magik/CheckList.java | 2 + .../sw/magik/checks/ScopeCountCheck.java | 63 +++++++++++++++++++ .../sw/sonar/l10n/magik/rules/ScopeCount.html | 1 + .../sw/sonar/l10n/magik/rules/ScopeCount.json | 15 +++++ .../sw/magik/checks/ScopeCountCheckTest.java | 49 +++++++++++++++ 6 files changed, 132 insertions(+) create mode 100644 magik-checks/src/main/java/org/stevenlooman/sw/magik/checks/ScopeCountCheck.java create mode 100644 magik-checks/src/main/resources/org/stevenlooman/sw/sonar/l10n/magik/rules/ScopeCount.html create mode 100644 magik-checks/src/main/resources/org/stevenlooman/sw/sonar/l10n/magik/rules/ScopeCount.json create mode 100644 magik-checks/src/test/java/org/stevenlooman/sw/magik/checks/ScopeCountCheckTest.java diff --git a/CHANGES.md b/CHANGES.md index f8a9a37d..8b7c958d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,8 @@ Changes 0.3.2 (unreleased) +- Add check ScopeCount + 0.3.1 (2019-09-22) diff --git a/magik-checks/src/main/java/org/stevenlooman/sw/magik/CheckList.java b/magik-checks/src/main/java/org/stevenlooman/sw/magik/CheckList.java index b74158ca..bbd17f09 100644 --- a/magik-checks/src/main/java/org/stevenlooman/sw/magik/CheckList.java +++ b/magik-checks/src/main/java/org/stevenlooman/sw/magik/CheckList.java @@ -10,6 +10,7 @@ import org.stevenlooman.sw.magik.checks.LocalImportProcedureCheck; import org.stevenlooman.sw.magik.checks.MethodComplexityCheck; import org.stevenlooman.sw.magik.checks.MethodDocCheck; +import org.stevenlooman.sw.magik.checks.ScopeCountCheck; import org.stevenlooman.sw.magik.checks.SimplifyIfCheck; import org.stevenlooman.sw.magik.checks.SizeZeroEmptyCheck; import org.stevenlooman.sw.magik.checks.SyntaxErrorCheck; @@ -46,6 +47,7 @@ public static List> getChecks() { LocalImportProcedureCheck.class, MethodComplexityCheck.class, MethodDocCheck.class, + ScopeCountCheck.class, SyntaxErrorCheck.class, SimplifyIfCheck.class, SizeZeroEmptyCheck.class, diff --git a/magik-checks/src/main/java/org/stevenlooman/sw/magik/checks/ScopeCountCheck.java b/magik-checks/src/main/java/org/stevenlooman/sw/magik/checks/ScopeCountCheck.java new file mode 100644 index 00000000..d00b3669 --- /dev/null +++ b/magik-checks/src/main/java/org/stevenlooman/sw/magik/checks/ScopeCountCheck.java @@ -0,0 +1,63 @@ +package org.stevenlooman.sw.magik.checks; + +import com.sonar.sslr.api.AstNode; +import com.sonar.sslr.api.AstNodeType; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.stevenlooman.sw.magik.MagikCheck; +import org.stevenlooman.sw.magik.analysis.scope.GlobalScope; +import org.stevenlooman.sw.magik.analysis.scope.Scope; +import org.stevenlooman.sw.magik.analysis.scope.ScopeEntry; +import org.stevenlooman.sw.magik.api.MagikGrammar; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +@Rule(key = ScopeCountCheck.CHECK_KEY) +public class ScopeCountCheck extends MagikCheck { + + public static final String CHECK_KEY = "ScopeCount"; + private static final String MESSAGE = "Too many variables in scope."; + private static final int DEFAULT_MAX_SCOPE_COUNT = 20; + @RuleProperty( + key = "max scope count", + defaultValue = "" + DEFAULT_MAX_SCOPE_COUNT, + description = "Maximum number of entries in scope") + public int maxScopeCount = DEFAULT_MAX_SCOPE_COUNT; + + @Override + public boolean isTemplatedCheck() { + return false; + } + + @Override + public List subscribedTo() { + return Arrays.asList( + MagikGrammar.METHOD_DEFINITION, + MagikGrammar.PROC_DEFINITION); + } + + /** + * Test if there are too many entries in the method/procedure scope. + * @param node Node to check. + */ + @Override + public void leaveNode(AstNode node) { + GlobalScope globalScope = getContext().getGlobalScope(); + if (globalScope == null) { + return; + } + + Scope procedureScope = globalScope.getScopeForNode(node); + List procedureScopeEntries = procedureScope.getSelfAndDescendantScopes().stream() + .map(scope -> scope.getScopeEntries()) + .flatMap(scopeEntries -> scopeEntries.stream()) + .filter(scopeEntry -> scopeEntry.getType() != ScopeEntry.Type.IMPORT) + .collect(Collectors.toList()); + if (procedureScopeEntries.size() > maxScopeCount) { + addIssue(MESSAGE, node); + } + } + +} diff --git a/magik-checks/src/main/resources/org/stevenlooman/sw/sonar/l10n/magik/rules/ScopeCount.html b/magik-checks/src/main/resources/org/stevenlooman/sw/sonar/l10n/magik/rules/ScopeCount.html new file mode 100644 index 00000000..f5656abd --- /dev/null +++ b/magik-checks/src/main/resources/org/stevenlooman/sw/sonar/l10n/magik/rules/ScopeCount.html @@ -0,0 +1 @@ +

The number of variables in scope is too high.

\ No newline at end of file diff --git a/magik-checks/src/main/resources/org/stevenlooman/sw/sonar/l10n/magik/rules/ScopeCount.json b/magik-checks/src/main/resources/org/stevenlooman/sw/sonar/l10n/magik/rules/ScopeCount.json new file mode 100644 index 00000000..274a2020 --- /dev/null +++ b/magik-checks/src/main/resources/org/stevenlooman/sw/sonar/l10n/magik/rules/ScopeCount.json @@ -0,0 +1,15 @@ +{ + "title": "Too many variables in scope", + "type": "CODE_SMELL", + "status": "ready", + "remediation": { + "func": "Constant\/Issue", + "constantCost": "30min" + }, + "tags": [ + "complexity" + ], + "defaultSeverity": "Major", + "ruleSpecification": "ScopeCount", + "sqKey": "scope-count" +} \ No newline at end of file diff --git a/magik-checks/src/test/java/org/stevenlooman/sw/magik/checks/ScopeCountCheckTest.java b/magik-checks/src/test/java/org/stevenlooman/sw/magik/checks/ScopeCountCheckTest.java new file mode 100644 index 00000000..1ddf3b68 --- /dev/null +++ b/magik-checks/src/test/java/org/stevenlooman/sw/magik/checks/ScopeCountCheckTest.java @@ -0,0 +1,49 @@ +package org.stevenlooman.sw.magik.checks; + +import static org.fest.assertions.Assertions.assertThat; + +import java.util.List; + +import org.junit.Test; +import org.stevenlooman.sw.magik.MagikIssue; + +public class ScopeCountCheckTest extends MagikCheckTestBase { + + @Test + public void testTooManyScopeEntries() { + ScopeCountCheck check = new ScopeCountCheck(); + check.maxScopeCount = 1; + String code = + "_method a.b\n" + + "\t_local l_a, l_b\n" + + "_endmethod"; + List issues = runCheck(code, check); + assertThat(issues).hasSize(1); + } + + @Test + public void testOk() { + ScopeCountCheck check = new ScopeCountCheck(); + check.maxScopeCount = 10; + String code = + "_method a.b\n" + + "\t_local l_a, l_b\n" + + "_endmethod"; + List issues = runCheck(code, check); + assertThat(issues).isEmpty(); + } + + @Test + public void testTooManyScopeEntriesGlobals() { + ScopeCountCheck check = new ScopeCountCheck(); + check.maxScopeCount = 1; + String code = + "_method a.b\n" + + "\t_global a, b\n" + + "_endmethod"; + List issues = runCheck(code, check); + assertThat(issues).hasSize(1); + } + + +} \ No newline at end of file From 64256a9a2bdc9cdf35f2b7e6aede995ea643715d Mon Sep 17 00:00:00 2001 From: Steven Looman Date: Wed, 2 Oct 2019 20:42:39 +0200 Subject: [PATCH 3/5] Add check UndefinedVariable --- CHANGES.md | 1 + .../org/stevenlooman/sw/magik/CheckList.java | 2 + .../magik/checks/UndefinedVariableCheck.java | 65 +++++++++++++++ .../sw/magik/checks/VariableNamingCheck.java | 3 +- .../l10n/magik/rules/UndefinedVariable.html | 14 ++++ .../l10n/magik/rules/UndefinedVariable.json | 15 ++++ .../checks/UndefinedVariableCheckTest.java | 81 +++++++++++++++++++ 7 files changed, 180 insertions(+), 1 deletion(-) create mode 100644 magik-checks/src/main/java/org/stevenlooman/sw/magik/checks/UndefinedVariableCheck.java create mode 100644 magik-checks/src/main/resources/org/stevenlooman/sw/sonar/l10n/magik/rules/UndefinedVariable.html create mode 100644 magik-checks/src/main/resources/org/stevenlooman/sw/sonar/l10n/magik/rules/UndefinedVariable.json create mode 100644 magik-checks/src/test/java/org/stevenlooman/sw/magik/checks/UndefinedVariableCheckTest.java diff --git a/CHANGES.md b/CHANGES.md index 8b7c958d..6be993f2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,7 @@ Changes 0.3.2 (unreleased) - Add check ScopeCount +- Add check UndefinedVariable 0.3.1 (2019-09-22) diff --git a/magik-checks/src/main/java/org/stevenlooman/sw/magik/CheckList.java b/magik-checks/src/main/java/org/stevenlooman/sw/magik/CheckList.java index bbd17f09..102d604b 100644 --- a/magik-checks/src/main/java/org/stevenlooman/sw/magik/CheckList.java +++ b/magik-checks/src/main/java/org/stevenlooman/sw/magik/CheckList.java @@ -15,6 +15,7 @@ import org.stevenlooman.sw.magik.checks.SizeZeroEmptyCheck; import org.stevenlooman.sw.magik.checks.SyntaxErrorCheck; import org.stevenlooman.sw.magik.checks.TrailingWhitespaceCheck; +import org.stevenlooman.sw.magik.checks.UndefinedVariableCheck; import org.stevenlooman.sw.magik.checks.UnusedVariableCheck; import org.stevenlooman.sw.magik.checks.VariableNamingCheck; import org.stevenlooman.sw.magik.checks.WarnedCallCheck; @@ -52,6 +53,7 @@ public static List> getChecks() { SimplifyIfCheck.class, SizeZeroEmptyCheck.class, TrailingWhitespaceCheck.class, + UndefinedVariableCheck.class, UnusedVariableCheck.class, VariableNamingCheck.class, WarnedCallCheck.class, diff --git a/magik-checks/src/main/java/org/stevenlooman/sw/magik/checks/UndefinedVariableCheck.java b/magik-checks/src/main/java/org/stevenlooman/sw/magik/checks/UndefinedVariableCheck.java new file mode 100644 index 00000000..a8ae5001 --- /dev/null +++ b/magik-checks/src/main/java/org/stevenlooman/sw/magik/checks/UndefinedVariableCheck.java @@ -0,0 +1,65 @@ +package org.stevenlooman.sw.magik.checks; + +import com.sonar.sslr.api.AstNode; +import com.sonar.sslr.api.AstNodeType; +import org.sonar.check.Rule; +import org.stevenlooman.sw.magik.MagikCheck; +import org.stevenlooman.sw.magik.analysis.scope.GlobalScope; +import org.stevenlooman.sw.magik.analysis.scope.Scope; +import org.stevenlooman.sw.magik.analysis.scope.ScopeEntry; +import org.stevenlooman.sw.magik.api.MagikGrammar; + +import java.util.Arrays; +import java.util.List; + +@Rule(key = UndefinedVariableCheck.CHECK_KEY) +public class UndefinedVariableCheck extends MagikCheck { + + public static final String CHECK_KEY = "UndefinedVariable"; + private static final String MESSAGE = + "Variable %s is expected to be declared, but used as a global."; + + @Override + public boolean isTemplatedCheck() { + return false; + } + + @Override + public List subscribedTo() { + return Arrays.asList( + MagikGrammar.METHOD_DEFINITION, + MagikGrammar.PROC_DEFINITION); + } + + /** + * Test if any global variable in the method/procedure scope has a prefix. + * @param node Node to check. + */ + @Override + public void leaveNode(AstNode node) { + GlobalScope globalScope = getContext().getGlobalScope(); + if (globalScope == null) { + return; + } + + Scope procedureScope = globalScope.getScopeForNode(node); + procedureScope.getSelfAndDescendantScopes().stream() + .map(scope -> scope.getScopeEntries()) + .flatMap(scopeEntries -> scopeEntries.stream()) + .filter(scopeEntry -> scopeEntry.getType() == ScopeEntry.Type.GLOBAL) + .filter(scopeEntry -> { + String identifier = scopeEntry.getIdentifier().toLowerCase(); + return identifier.startsWith("l_") + || identifier.startsWith("i_") + || identifier.startsWith("p_") + || identifier.startsWith("c_"); + }) + .forEach(scopeEntry -> { + AstNode scopeEntryNode = scopeEntry.getNode(); + String identifier = scopeEntry.getIdentifier(); + String message = String.format(MESSAGE, identifier); + addIssue(message, scopeEntryNode); + }); + } + +} diff --git a/magik-checks/src/main/java/org/stevenlooman/sw/magik/checks/VariableNamingCheck.java b/magik-checks/src/main/java/org/stevenlooman/sw/magik/checks/VariableNamingCheck.java index 223bbd48..b59a51bd 100644 --- a/magik-checks/src/main/java/org/stevenlooman/sw/magik/checks/VariableNamingCheck.java +++ b/magik-checks/src/main/java/org/stevenlooman/sw/magik/checks/VariableNamingCheck.java @@ -44,7 +44,8 @@ private String stripPrefix(String identifier) { String lowered = identifier.toLowerCase(); if (lowered.startsWith("p_") || lowered.startsWith("l_") - || lowered.startsWith("i_")) { + || lowered.startsWith("i_") + || lowered.startsWith("c_")) { return identifier.substring(2); } return identifier; diff --git a/magik-checks/src/main/resources/org/stevenlooman/sw/sonar/l10n/magik/rules/UndefinedVariable.html b/magik-checks/src/main/resources/org/stevenlooman/sw/sonar/l10n/magik/rules/UndefinedVariable.html new file mode 100644 index 00000000..52b276f4 --- /dev/null +++ b/magik-checks/src/main/resources/org/stevenlooman/sw/sonar/l10n/magik/rules/UndefinedVariable.html @@ -0,0 +1,14 @@ +

The prefixed variable indicates it should have been declared in the local scope, but was used as a global.

+

Noncompliant Code Example

+
+_method object.do_something()
+  write(l_a)
+_endmethod
+
+

Compliant Solution

+
+_method object.do_something()
+  _local l_a << 10
+  write(l_a)
+_endmethod
+
diff --git a/magik-checks/src/main/resources/org/stevenlooman/sw/sonar/l10n/magik/rules/UndefinedVariable.json b/magik-checks/src/main/resources/org/stevenlooman/sw/sonar/l10n/magik/rules/UndefinedVariable.json new file mode 100644 index 00000000..9491ddce --- /dev/null +++ b/magik-checks/src/main/resources/org/stevenlooman/sw/sonar/l10n/magik/rules/UndefinedVariable.json @@ -0,0 +1,15 @@ +{ + "title": "Prefixed variable used as a global", + "type": "BUG", + "status": "ready", + "remediation": { + "func": "Constant\/Issue", + "constantCost": "15min" + }, + "tags": [ + "error" + ], + "defaultSeverity": "Major", + "ruleSpecification": "UndefinedVariable", + "sqKey": "undefined-variable" +} diff --git a/magik-checks/src/test/java/org/stevenlooman/sw/magik/checks/UndefinedVariableCheckTest.java b/magik-checks/src/test/java/org/stevenlooman/sw/magik/checks/UndefinedVariableCheckTest.java new file mode 100644 index 00000000..8b5cca96 --- /dev/null +++ b/magik-checks/src/test/java/org/stevenlooman/sw/magik/checks/UndefinedVariableCheckTest.java @@ -0,0 +1,81 @@ +package org.stevenlooman.sw.magik.checks; + +import static org.fest.assertions.Assertions.assertThat; + +import java.util.List; + +import org.junit.Test; +import org.stevenlooman.sw.magik.MagikCheck; +import org.stevenlooman.sw.magik.MagikIssue; + +public class UndefinedVariableCheckTest extends MagikCheckTestBase { + + @Test + public void testDefinedLocalUsed() { + MagikCheck check = new UndefinedVariableCheck(); + String code = + "_method a.b\n" + + "\t_local l_a << 10\n" + + "\twrite(l_a)\n" + + "_endmethod"; + List issues = runCheck(code, check); + assertThat(issues).isEmpty(); + } + + @Test + public void testDefinedDefinitionUsed() { + MagikCheck check = new UndefinedVariableCheck(); + String code = + "_method a.b\n" + + "\tl_a << 10\n" + + "\twrite(l_a)\n" + + "_endmethod"; + List issues = runCheck(code, check); + assertThat(issues).isEmpty(); + } + + @Test + public void testUndefinedLocalUsed() { + MagikCheck check = new UndefinedVariableCheck(); + String code = + "_method a.b\n" + + "\twrite(l_a)\n" + + "_endmethod"; + List issues = runCheck(code, check); + assertThat(issues).hasSize(1); + } + + @Test + public void testDefinedLocalUsedProcedure() { + MagikCheck check = new UndefinedVariableCheck(); + String code = + "_proc()\n" + + "\t_local l_a\n" + + "\twrite(l_a)\n" + + "_endproc"; + List issues = runCheck(code, check); + assertThat(issues).isEmpty(); + } + + @Test + public void testUndefinedLocalUsedProcedure() { + MagikCheck check = new UndefinedVariableCheck(); + String code = + "_proc()\n" + + "\twrite(l_a)\n" + + "_endproc"; + List issues = runCheck(code, check); + assertThat(issues).hasSize(1); + } + + @Test + public void testParameter() { + MagikCheck check = new UndefinedVariableCheck(); + String code = + "_method a.b(p_a)\n" + + "_endmethod"; + List issues = runCheck(code, check); + assertThat(issues).isEmpty(); + } + +} \ No newline at end of file From ff93ace361f21744105377402681b874de77dd6e Mon Sep 17 00:00:00 2001 From: Steven Looman Date: Thu, 3 Oct 2019 19:50:21 +0200 Subject: [PATCH 4/5] Fix LocalImportProcedureCheck not properly handling non-locals/definitions --- CHANGES.md | 1 + .../sw/magik/checks/LocalImportProcedureCheck.java | 3 ++- .../checks/LocalImportProcedureCheckTest.java | 14 +++++++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 6be993f2..28f94453 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ Changes - Add check ScopeCount - Add check UndefinedVariable +- Fix LocalImportProcedureCheck not properly handling non-locals/definitions 0.3.1 (2019-09-22) diff --git a/magik-checks/src/main/java/org/stevenlooman/sw/magik/checks/LocalImportProcedureCheck.java b/magik-checks/src/main/java/org/stevenlooman/sw/magik/checks/LocalImportProcedureCheck.java index e197b8c8..43c338aa 100644 --- a/magik-checks/src/main/java/org/stevenlooman/sw/magik/checks/LocalImportProcedureCheck.java +++ b/magik-checks/src/main/java/org/stevenlooman/sw/magik/checks/LocalImportProcedureCheck.java @@ -54,7 +54,8 @@ public void visitNode(AstNode node) { for (Scope scope: childScopes) { for (ScopeEntry scopeEntry: scope.getScopeEntries()) { boolean found = false; - if (scopeEntry.getType() == ScopeEntry.Type.IMPORT) { + if (scopeEntry.getType() != ScopeEntry.Type.LOCAL + && scopeEntry.getType() != ScopeEntry.Type.DEFINITION) { continue; } diff --git a/magik-checks/src/test/java/org/stevenlooman/sw/magik/checks/LocalImportProcedureCheckTest.java b/magik-checks/src/test/java/org/stevenlooman/sw/magik/checks/LocalImportProcedureCheckTest.java index d754bae3..28ff0c7d 100644 --- a/magik-checks/src/test/java/org/stevenlooman/sw/magik/checks/LocalImportProcedureCheckTest.java +++ b/magik-checks/src/test/java/org/stevenlooman/sw/magik/checks/LocalImportProcedureCheckTest.java @@ -37,7 +37,19 @@ public void testLocalButMeantImport() { " _endproc\n" + "_endmethod"; List issues = runCheck(code, check); - assertThat(issues).isNotEmpty(); + assertThat(issues).hasSize(1); + } + + @Test + public void testMethodProcedureParameter() { + MagikCheck check = new LocalImportProcedureCheck(); + String code = + "_method a.a(p_a)\n" + + " _proc(p_a)\n" + + " _endproc\n" + + "_endmethod"; + List issues = runCheck(code, check); + assertThat(issues).isEmpty(); } @Test From 079ce0057613dbc804ae2b06e42666ef82c0493b Mon Sep 17 00:00:00 2001 From: Steven Looman Date: Tue, 29 Oct 2019 19:51:45 +0100 Subject: [PATCH 5/5] Releasing 0.3.2 --- CHANGES.md | 2 +- magik-checks/pom.xml | 2 +- magik-lint/pom.xml | 2 +- magik-squid/pom.xml | 2 +- pom.xml | 2 +- sonar-magik-plugin/pom.xml | 2 +- sslr-magik-toolkit/pom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 28f94453..d5506213 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,7 +1,7 @@ Changes ======= -0.3.2 (unreleased) +0.3.2 (2019-10-29) - Add check ScopeCount - Add check UndefinedVariable diff --git a/magik-checks/pom.xml b/magik-checks/pom.xml index 9fa2b2ab..2d5cc107 100644 --- a/magik-checks/pom.xml +++ b/magik-checks/pom.xml @@ -6,7 +6,7 @@ org.stevenlooman.sw.sonar sonar-magik - 0.3.2-SNAPSHOT + 0.3.2 magik-checks diff --git a/magik-lint/pom.xml b/magik-lint/pom.xml index 683d7547..31ccd0ae 100644 --- a/magik-lint/pom.xml +++ b/magik-lint/pom.xml @@ -6,7 +6,7 @@ org.stevenlooman.sw.sonar sonar-magik - 0.3.2-SNAPSHOT + 0.3.2 magik-lint diff --git a/magik-squid/pom.xml b/magik-squid/pom.xml index 07c4295c..dbd4461c 100644 --- a/magik-squid/pom.xml +++ b/magik-squid/pom.xml @@ -6,7 +6,7 @@ org.stevenlooman.sw.sonar sonar-magik - 0.3.2-SNAPSHOT + 0.3.2 magik-squid diff --git a/pom.xml b/pom.xml index 295fb312..9558c608 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 org.stevenlooman.sw.sonar sonar-magik - 0.3.2-SNAPSHOT + 0.3.2 pom Magik diff --git a/sonar-magik-plugin/pom.xml b/sonar-magik-plugin/pom.xml index 9212b242..a0ff834e 100644 --- a/sonar-magik-plugin/pom.xml +++ b/sonar-magik-plugin/pom.xml @@ -6,7 +6,7 @@ org.stevenlooman.sw.sonar sonar-magik - 0.3.2-SNAPSHOT + 0.3.2 sonar-magik-plugin diff --git a/sslr-magik-toolkit/pom.xml b/sslr-magik-toolkit/pom.xml index 108b20d9..99fc1c67 100644 --- a/sslr-magik-toolkit/pom.xml +++ b/sslr-magik-toolkit/pom.xml @@ -6,7 +6,7 @@ org.stevenlooman.sw.sonar sonar-magik - 0.3.2-SNAPSHOT + 0.3.2 sslr-magik-toolkit