Skip to content

Commit

Permalink
Makefile: make format (#712)
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.

(cherry picked from commit d6dcd86)

Signed-off-by: rkhapov <[email protected]>
(cherry picked from commit b494f12)
Signed-off-by: rkhapov <[email protected]>
  • Loading branch information
rkhapov authored and rkhapov committed Nov 15, 2024
1 parent 1e00d3f commit 6eb181b
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 6eb181b

Please sign in to comment.