diff options
author | Adrian Reber <areber@redhat.com> | 2021-06-26 20:19:43 +0300 |
---|---|---|
committer | Andrei Vagin <avagin@gmail.com> | 2021-09-03 20:31:00 +0300 |
commit | 1e26f170caa8b2c26f5d09a78ffe9fdea70d38d0 (patch) | |
tree | ae5fd78eb2df926233cbf5816be242baebf09127 /Makefile | |
parent | cc2317ea4863f1783566fc505e4a3cfe57d29033 (diff) |
criu: introduce clang-format to format source code
This is another attempt to introduce a tool to format CRIU's source
code. This time it is based on clang-format.
The .clang-format file is taken from the linux kernel git tree (5.13).
I removed all comments from lines which state that it requires at least
clang-format 4 or 5. For this resulting file at least clang-format 11
is required. See scripts/fetch-clang-format.sh for all the changes
done to the Linux kernel .clang-format file.
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Adrian Reber <areber@redhat.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -202,7 +202,7 @@ criu-deps += include/common/asm # # Configure variables. export CONFIG_HEADER := include/common/config.h -ifeq ($(filter tags etags cscope clean mrproper,$(MAKECMDGOALS)),) +ifeq ($(filter tags etags cscope clean lint indent fetch-clang-format help mrproper,$(MAKECMDGOALS)),) include Makefile.config else # To clean all files, enable make/build options here @@ -398,6 +398,8 @@ help: @echo ' test - Run zdtm test-suite' @echo ' gcov - Make code coverage report' @echo ' unittest - Run unit tests' + @echo ' lint - Run code linters' + @echo ' indent - Indent C code' .PHONY: help lint: @@ -429,6 +431,14 @@ codecov: bash <(curl -s https://codecov.io/bash) .PHONY: codecov +fetch-clang-format: .FORCE + $(E) ".clang-format" + $(Q) scripts/fetch-clang-format.sh + +indent: + find . -name '*.[ch]' -type f -print0 | xargs --null --max-args 128 --max-procs 4 clang-format -i +.PHONY: indent + include Makefile.install .DEFAULT_GOAL := all |