-
Notifications
You must be signed in to change notification settings - Fork 362
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
Custom rules limited to 4000 chars #1548
Comments
Hi @gerboengels,
thanks for this hint. Think we can't workaround this because seems to be an SQ core issue. Like to ask you to create an issue in the SQ community: https://community.sonarsource.com/ Regards, |
@gerboengels how have you find this? We have some big xml filea also but we
havent notice any crashes or anytbing
…On Tue, 28 Aug 2018, 17:13 Günter Wirth, ***@***.***> wrote:
Hi @gerboengels <https://github.com/gerboengels>,
"Administration > C++ (Community) > Clang-Tidy custom rules" which exceeds
the (new) limit of 4000 characters.
thanks for this hint. Think we can't workaround this because seems to be
an SQ core issue. Like to ask you to create an issue in the SQ community:
https://community.sonarsource.com/
Regards,
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1548 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA_jyGO7RRMgy5ttBobt_F4T_DjGpNZzks5uVVAKgaJpZM4WPq-c>
.
|
@jmecosta Did you try editing Clang-Tidy custom rules through SonarQube UI in latest release? |
@jmecosta I found this after upgrading SQ from 6.x to 7.2, and then trying to modify the mentioned field. When clicking on save, the UI says it cannot be saved. But no crashes or anything. |
@yachoor Will try editing the database directly |
@yachoor ok, we dont have probelms since we are only using the custom rules place holder and those do not face this issue. and to be honest that one will stop working at some point since its the same type of variable however its a multivalue property and for some reason there is not check on that in the ui. Supose db has not limitations. that said: @guwirth, @Bertk due to this newly introduced limitation. we can have 2 ooptions, 1, drop this support. and let users create the rules using rest api. I do this all the time. what would be the best solution? |
@jmecosta independent which way we are going: could you describe how it works with the REST API? Which commands are you using?
Don't know if this is a good idea. Have the feeling the configuration interface is already too big. |
would be something like this: the user can straight away create new rules based on this template rule. since this would be really a big work then you can use the "/api/rules/create" to post a new rule. how users use the rest end point its up to them, im using a f# library see this would solve the current problem. however its a bit more work for end users. |
Last time I checked it did not allow to create rules with keys containing '-'. Before there was clang-tidy support I used to pass it's output as gcc with template rules, but I had to replace every '-' with '_' when creating rule from template and than fix it manually in database. |
SQ will add an API to relating external rule info https://jira.sonarsource.com/browse/MMF-1332. Maybe that is an solution? |
step 1 in order to address SonarOpenCommunity#1560 (and SonarOpenCommunity#1548) * TableGen -dump-json over the Diagnostic.td and parse te resulting json * The result is identical to http://clang.llvm.org/docs/DiagnosticsReference.html
addresses SonarOpenCommunity#1560 fixes SonarOpenCommunity#1548 * gnerate JSON file from Diagnositc.td `llvm-tblgen -dump-json <src_dir>/tools/clang/include/clang/Basic/Diagnostic.td > output.json` * parse JSON in order to generate rules ( incl. types, severities and descriptions) * the result is identical to http://clang.llvm.org/docs/DiagnosticsReference.html TODO * check if prefix 'clang-diagnostics-' applies to all diagnositcs * check if rule-IDs in clang-tidy report match the rule-IDs in the clangtidy.xml
addresses SonarOpenCommunity#1560 fixes SonarOpenCommunity#1548 * gnerate JSON file from Diagnositc.td `llvm-tblgen -dump-json <src_dir>/tools/clang/include/clang/Basic/Diagnostic.td > output.json` * parse JSON in order to generate rules ( incl. types, severities and descriptions) * the result is identical to http://clang.llvm.org/docs/DiagnosticsReference.html TODO * check if prefix 'clang-diagnostics-' applies to all diagnositcs * check if rule-IDs in clang-tidy report match the rule-IDs in the clangtidy.xml
addresses SonarOpenCommunity#1560 fixes SonarOpenCommunity#1548 * gnerate JSON file from Diagnositc.td `llvm-tblgen -dump-json <src_dir>/tools/clang/include/clang/Basic/Diagnostic.td > output.json` * parse JSON in order to generate rules ( incl. types, severities and descriptions) * the result is identical to http://clang.llvm.org/docs/DiagnosticsReference.html TODO * check if prefix 'clang-diagnostics-' applies to all diagnositcs * check if rule-IDs in clang-tidy report match the rule-IDs in the clangtidy.xml
Since SonarQube 7.0, there is a limit on the length of configuration settings. In our case, we use some XML in "Administration > C++ (Community) > Clang-Tidy custom rules" which exceeds the (new) limit of 4000 characters. Before SonarQube 7.0 this limit did not exist.
I think the regression was introduced in this SonarQube commit, for feature 10040.
I don't know whether the cxx plugin can work around the issue, or if it should be fixed in SonarQube?
cxx plugin version: 1.0.0
Current SonarQube version: 7.2.0.13530
The text was updated successfully, but these errors were encountered: