Feature #5087
CI: gerrit-verifications: run clang static analyzer and syntax check on patches
0%
Description
As discussed yesterday: it would be useful to run clang in the gerrit-verifications job, before and after the patch has been applied, and report (-> let gerrit verifications fail) if there is something in the diff.
The idea is to prevent the need for pointing out trivial syntax errors in code review, and to have the static analyzer find bugs automatically.
We would only run it on the diff, so we don't need to adjust the whole code base of each project.
History
#1 Updated by fixeria 23 days ago
Here is a script that is used in srsLTE: https://github.com/srsLTE/srsLTE/blob/master/run-clang-format-diff.sh
#2 Updated by laforge 23 days ago
On Wed, Mar 24, 2021 at 03:10:08PM +0000, fixeria [REDMINE] wrote:
Here is a script that is used in srsLTE: https://github.com/srsLTE/srsLTE/blob/master/run-clang-format-diff.sh
I think that's the first shell script under AGPLv3 that I consciously notice :)
I also wonder what that "python3 -c 'data = open(0).read(); print(data); exit(1 if data else 0)')" script is really for? Checking if stdout is of non-zero length?
#3 Updated by osmith 23 days ago
Thanks for posting the script, fixeria!
laforge wrote:
I also wonder what that "python3 -c 'data = open(0).read(); print(data); exit(1 if data else 0)')" script is really for? Checking if stdout is of non-zero length?
Yes, exit with 1 if clang-format-diff output is not a zero-length string.