[petsc-dev] make checkclangformat checkbadSource dependencies

Jacob Faibussowitsch jacob.fai at gmail.com
Sun Jun 18 15:37:37 CDT 2023


> I want to automatically run make checkclangformat checkbadSource before every git push (because I am an idiot and have too many silly failed CIs due to bad source). 

What you *actually* want are git hooks (https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) combined with clang-format-diff (https://clang.llvm.org/docs/ClangFormat.html#script-for-patch-reformatting).

I floated the idea of adding git hooks ages ago, but it was shot down for some reason.

Best regards,

Jacob Faibussowitsch
(Jacob Fai - booss - oh - vitch)

> On Jun 18, 2023, at 16:33, Barry Smith <bsmith at petsc.dev> wrote:
> 
> 
>  I have never understood how to do make rule dependencies when one is not explicitly generating new files from old ones. For example, .o from .c
> 
> I want to automatically run make checkclangformat checkbadSource before every git push (because I am an idiot and have too many silly failed CIs due to bad source). 
> 
> Currently, we use git ls-files and check every single file each time, even though I have not changed all 5,000 source files in PETSc before a push.
> Is there someone who understands make dependencies when no files are generated who could reduce make checkclangformat and checkbadSource to under a second?
> 
> 
>  Thanks
> 
>  Barry
> 



More information about the petsc-dev mailing list