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

Git check works only for last commit #7

Open DanielChabrowski opened 6 years ago

DanielChabrowski commented 6 years ago

Hey, git diff --check HEAD^ will not work on all commits from PR rendering using it on CI kinda useless.

I don't think there is a way to make it fully generic using git diff unless you make some assumptions like that PRs are always targeting certain branch, but if there is, I would love to know about it.

rianquinn commented 6 years ago

So far we haven't had any real issues, and we use this code pretty heavily on the following project: https://github.com/Bareflank/hypervisor/blob/dev/scripts/util/bareflank_clang_tidy.sh#L74

The line is a little different as we did fix an issue with deleted files, something we should fix in this repo as well.