Skip to content

Commit

Permalink
Makefile: make format
Browse files Browse the repository at this point in the history
This new command will help to run format on different envs
because of running formatting inside docker.

Previous make fmt will stay, but is not very suitable.

Signed-off-by: rkhapov <[email protected]>
(cherry picked from commit d6dcd86)
Signed-off-by: rkhapov <[email protected]>
  • Loading branch information
rkhapov committed Nov 5, 2024
1 parent f5d29e6 commit 5c64f6d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ fmt:
docker build -f docker/format/Dockerfile --tag=odyssey/clang-format-runner .
docker run -v .:/odyssey:ro odyssey/clang-format-runner modules sources stress test third_party

format:
docker build -f docker/format/Dockerfile --tag=odyssey/clang-format-runner .
docker run --user=`stat -c "%u:%g" .` -v .:/odyssey:rw odyssey/clang-format-runner -i modules sources stress test third_party

apply_fmt:
for d in sources test third_party stress modules ; do \
find $$d -maxdepth 5 -iname '*.h' -o -iname '*.c' | xargs -n 1 -t -P $(CONCURRENCY) $(FMT_BIN) -i ; \
Expand Down

0 comments on commit 5c64f6d

Please sign in to comment.