ainfosec / ci_helloworld

A simple example of how to setup a complete CI environment for C and C++
MIT License
394 stars 76 forks source link

Add Clang 5.0 static analysis with scan-build #6

Closed tklengyel closed 6 years ago

codecov-io commented 7 years ago

Codecov Report

Merging #6 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master     #6   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           6      6           
  Lines          27     27           
=====================================
  Hits           27     27

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7e026ca...a6c6bbb. Read the comment docs.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling a6c6bbb367085fb734d7d810b2c3931c9091e0cf on tklengyel:clang_5_analyze into 7e026cae19cb8bdb4362e6cd7468c724d7c3a569 on ainfosec:master.

rianquinn commented 7 years ago

since we already do static analysis with clang, I would prefer to simply update that test to 5.0 as Clang Tidy is finding a lot more things than scan-build is (it only does the static analysis part), which means all it's doing is slowing down that particular test. Thoughts?

tklengyel commented 7 years ago

I guess since scan-build ships with clang by default it's a useful option in case you don't want to install extra stuff. Also my impression with clang tidy was that it won't work for C projects?

rianquinn commented 7 years ago

Works fine for C projects. I'm fine with showing examples of how to set it up, but I wouldn't add it to the default for clang 5.0

tklengyel commented 7 years ago

Adding a separate clang 5.0 build would make sense. I'm looking for an easy way to setup clang tidy for an autotools project and there is just not much info about it out there. :/

rianquinn commented 7 years ago

Yeah, all you need to do is get autotools to spit out a JSON database. I would start with this project as we used to use this and it worked great: https://github.com/rizsotto/Bear

rianquinn commented 7 years ago

Once you have a database, you can run Clang-Tidy without issue (assuming clang was used as the compiler of course).