-
Notifications
You must be signed in to change notification settings - Fork 363
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
add cxxlint #791
add cxxlint #791
Conversation
@jmecosta in general I like the idea of testing the code locally before adding it to the database. Some thoughts from my side:
But I'm also interested to hear opinion from others... |
A tool which runs the checks locally will be very helpful but the configuration from the SonarQube server has to be used as well. This is anyway the main stream approach and the developer should have the chance to fix the issue before a commit ist done. |
@guwirth regarding preview mode, for the cxx plugin is not really feasible. it takes to long for big projects and new versions of sq dont even allow running agains only modified files. anyway the lint idea is not to compete with those modes. but to provide analysis while you are writing code. for the keeping this in separate plugin i dont like it, mainly because the linter references a version of the cxx-checks and soon people will start using different versions in server and locally. putting in the cxx-plugin makes the versions always the same. for example the sonar cs lint is embeeded also in the plugin but as a external artifact that will cause what i described earlier. for the amount of checks the cxx plugin provides, there are a few that are very useful like complexity (this was the reason why i decided to put this) we dont have those in any external tool that can be configured according with the value in the rule. furthermore people are likely not using more the cxx checks because we dont provide a linter to run it locally. @Bertk the profile can be passed via -s settings. from my side in visual studio i will handle this logic since its wise to set the file only once when solution is open rather than continuously polling the server everytime the linter runs. plus you should be able to run the linter without any access to server. for example a settings file can be exported and keep in the repository and the you build some tool to run the linter using this settings file. I dont think its wise to put more logic other than run the checks and report in the linter. @guwirth @Bertk i agree with Bert that once this is available locally more people will be interested in creating more checks. and at least replace vera for starting up |
@@ -109,6 +109,7 @@ | |||
<modules> | |||
<module>cxx-squid</module> | |||
<module>cxx-checks</module> | |||
<module>CxxLint</module> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
proposal to align path name: cxx-lint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@guwirth @Bertk this is ready. you can try this in visual studio by installing this: https://github.com/TrimbleSolutionsCorporation/VSSonarQubeExtension/releases/tag/5.1.0-RC23 highlights of the visual studio integration:
feel free to try out and give feedback. i will soon release this to gallery |
the windows build is failing, but i think is a issue with appveyour likely lack of space? And the server log (if locatable) contains no error/warning messages anyway, if this still fails after merging. we can then later add those to the ignore list. |
Thanks for providing this. Folder name seems to be still cxxlint instead of cxx-lint? Build and too less space: maybe an idea to delete temporary files.
|
@guwirth you mean the package name:
i tought we did not use |
@guwirth regarding the build space, perhapps then its better to add those to the ignore list. since it should be quite random to happen |
@jmecosta sorry was wrong, saw only the last cxxlint in the path. The root is already cxx-lint. |
@guwirth @Bertk one of the things of using clang was that it could be made into a standalone analyser and reuse in local analysis before files are commit.
in fact, there is not reason why we cant do the same for the cxx plugin as it us. ive create a small console application that can be run to generate issues using the current cxx checks.
the sintax is easy:
java -jar E:\Development\SonarQube\cxx\sonar-cxx\CxxLint\target\CxxLint-0.9.5-SNAPSHOT.jar -f d:\prod\structures\Core\Common\common\Common.cpp -s e:\CxxLintConfig.json
where CxxLintConfig.json is optional and is meant to give more info to the analysis:
this will provide issues like this:
ive change this plugin to embeed the jar so, users can download from sonar like this:
http://localhost:9000/static/cxx/CxxLint-0.9.5-SNAPSHOT.jar
i was thinking now to include this in my visual studio extension so i can report all missing issues also from the cxx plugin and not only for vera , cppcheck and so on
what do you guys think?