Skip to content
Snippets Groups Projects

enh(ci): add static analysis

Merged Lucas SCHMIDT requested to merge 47-ci-add-static-analysis into dev

Description

A lot of time is spent during review to spot mistakes that could be detected automatically by a static analysis tool. CppCheck was disabled in the CI because it took too much time to run, however it takes only 2 minutes on my machine to scan the whole Sight library, so I believe it can be re-enabled. I tested on an MR with 33 C++ file changes, it takes only 28 seconds to run, which is pretty fast. I also tested with around 2500 C++ file changes (nearly all Sight) and it only takes 7 minutes to run, which is pretty fast as well.

I will also add Clang-Tidy on the CI, however it requires a compile_commands.json to work, which only CMake can generate, as such it can't be added as a Sheldon hook. I will add it directly on Sight CI script in a Sight MR.

Closes #47 (closed)

How to test it?

Run the cppcheck hook. It should manage to run and display useful messages, without false positives.

Additional tests/tasks to run

  • Check if it runs in a reasonable time on the Sight CI
  • Add Clang-Tidy on the CI as well (not possible as a Sheldon hook, must be directly on the Sight CI script)
Edited by Lucas SCHMIDT

Merge request reports

Pipeline #203030 passed

Pipeline passed for 3f8d3b0e on 47-ci-add-static-analysis

Approved by

Merged by Flavien BRIDAULTFlavien BRIDAULT 2 years ago (May 20, 2022 3:44pm UTC)

Loading

Pipeline #205127 passed

Pipeline passed for ce883e11 on dev

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading