mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
Previousely "make indent" checked all files in criu source directory for codding style flaws. We have several problems with it: - clang-format default format sometimes changes in new versions of the package and we need to reformat all our code base each time it happens - on different systems we may have different versions of clang-format and on latest criu-dev "make indent" may be still unhappy on your system - when we want to update clang-format rules ourselves we need to update all our code base each time - sometimes clang-format rules are not fitting all our cases, (e.g.: an option IndentGotoLabels works nice for simple C code, but is a no go for assembler and C macros) and putting "clang-format off" everywhere is a mess - sometimes we intentionally want to break clang-format rules (e.g.: we want to put function arguments on a new line separating them "logically" not "mechanically" following 120-char rule like clang-format does). This adds a BASE option for "make indent" where all commits in range BASE..HEAD would be checked with git-clang-format for codding style flaws. For instance when developing on top of criu-dev, one can use "make BASE=origin/criu-dev indent" to check all their commits for compliance with the clang-format rules. Default base is HEAD~1 to make last commit checked when "make indent" is called. The closest thing to the old behaviour would then be "make indent BASE=init", note that only commited files would be checked. Extra options to git-clang-format may be passed through OPTS variable. Also reuse "make indent" in github lint workflow. Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com> |
||
|---|---|---|
| .. | ||
| workflows | ||
| ISSUE_TEMPLATE.md | ||
| PULL_REQUEST_TEMPLATE.md | ||