-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error: cannot find symbol- subscribeTo(DmlGrammar.TABLE_DECLARATION); #171
Comments
Hi Filepe, Please check it and let me know if you have any fix for this issue. Thanks |
Hi Filepe, As you said, I did subscribed to DdlGrammer.CREATE_TABLE and I am still getting the same error as before. C:\myfiles\zpa-Latest>gradlew build -p plsql-custom-rules
FAILURE: Build failed with an exception.
BUILD FAILED in 12s C:\myfiles\zpa-Latest> Not sure what went wrong in this Thanks |
Unfortunately, the version you are using is very old and I’m unable to provide support for it. I suggest that you update the plugin to the latest version on the SonarQube server and follow the instructions at Create a plugin with custom rules. |
Hi Filepe, Plugin compatibility has been fixed by build.gradle file by replacing the following line with this "implementation("com.felipebz.zpa:sonar-zpa-plugin:3.0.0")" But I am still getting the following error: It says:
FAILURE: Build failed with an exception.
BUILD FAILED in 1s Please advise how to fix this issue. Thanks |
Hi Filepe, Latest error is "
FAILURE: Build failed with an exception.
BUILD FAILED in 7s C:\myfiles\zpa-Latest> Thanks |
Hi,
This line doesn't exist in the example: zpa/plsql-custom-rules/src/test/java/com/company/plsql/PlSqlCustomRulesDefinitionTest.java Lines 3 to 12 in 8103d9b
And these errors indicate that's you're using the wrong version of the SonarQube API. You said before that you changed the dependency to zpa/plsql-custom-rules/src/test/java/com/company/plsql/PlSqlCustomRulesDefinitionTest.java Line 15 in 84671bf
It seems that's something wrong your build file and and it's quite hard for me to help you without knowing exactly what files you changed, what versions you're using.... I suggest you to get the whole |
Hi Felipe, Thanks for the advise. As you said I used the latest 3.2.1 code from (https://codeload.github.com/felipebz/zpa/zip/refs/tags/3.2.1) you shared. It helped a lot. `package com.company.plsql; import org.sonar.plugins.plsqlopen.api.DdlGrammar; import java.util.regex.Pattern; @rule(
`Picked up JAVA_TOOL_OPTIONS: -Djava.vendor="Sun Microsystems Inc." PlSqlCustomRulesDefinitionTest > test() STANDARD_OUT PlSqlCustomRulesDefinitionTest > test() FAILED TableNameCheckTest > testExceptions() STANDARD_OUT TableNameCheckTest > testIncorrectNamingConvention() STANDARD_OUT TableNameCheckTest > testCorrectNamingConvention() STANDARD_OUT 6 tests completed, 1 failed FAILURE: Build failed with an exception.` It is giving me this error, even though I have updated the size from 1 to 2, `public class PlSqlCustomRulesDefinitionTest {
}` Not sure what am I missing. Please advise. Thanks |
Hi Felipe, I am able to compile the plugin. Please check the following logs & advise how to fix. PlSqlRulingTest > pljson() FAILED PlSqlRulingTest > alexandria_plsql_utils() FAILED PlSqlRulingTest > utPLSQL2() FAILED PlSqlRulingTest > utPLSQL3() FAILED Thanks |
Hi Felipe, Please let me know if you have any update on this. Thanks |
Hi Felipe, I am testing your plugin downloaded and without making any changes. I thought it was failing tests because of files i have added to create my custom rule. But it seems like that is not the issue at all. Above logs were produced with zpa plugin version 3.2.0. source code - integration test, without making any chnags to actual source code. Please find these logs and let me know, what are we missing here and how to fix it.. Thanks |
Hi Felipe, Please let me know if there is a possibility to fix this error, as it is a blocker for us proceed to experiment on implementing new custom rules using your plugin. Because the basic plugin also having issues passing the integrationTest. Any update from your end would help us. Thanks |
I am trying to write a custom rule to implement TableName check,
But I am facing compilation errors. Please suggest how to achieve this.
ERROR:
C:\myfiles\zpa-Latest>gradlew build -p plsql-custom-rules
Picked up JAVA_TOOL_OPTIONS: -Djava.vendor="Sun Microsystems Inc."
FAILURE: Build failed with an exception.
Execution failed for task ':compileJava'.
BUILD FAILED in 4s
1 actionable task: 1 executed
Here is my custom rule class
package com.company.plsql;
import java.util.regex.Pattern;
import org.sonar.plugins.plsqlopen.api.annotations.Priority;
import org.sonar.plugins.plsqlopen.api.annotations.Rule;
import org.sonar.plugins.plsqlopen.api.DmlGrammar;
import org.sonar.plugins.plsqlopen.api.annotations.ActivatedByDefault;
import org.sonar.plugins.plsqlopen.api.annotations.ConstantRemediation;
import org.sonar.plugins.plsqlopen.api.checks.PlSqlCheck;
import org.sonar.plugins.plsqlopen.api.sslr.AstNode;
import org.sonar.plugins.plsqlopen.api.PlSqlGrammar;
import org.sonar.plugins.plsqlopen.api.DmlGrammar;
@rule(
name = "Table Naming Conventions",
description = "Ensure tables follow the defined naming conventions.",
key = "TableNamingCheck",
priority = Priority.MAJOR
)
@ConstantRemediation("10min")
@ActivatedByDefault
public class TableNamingCheck extends PlSqlCheck {
}
NOTE: I also tried with PlSqlGrammar.TABLE_DECLARATION; But still got the same error.
Please suggest an alternative way to achieve this.
The text was updated successfully, but these errors were encountered: