From 023bb5e7661bdf61ef79b07d2d1181ce092f6505 Mon Sep 17 00:00:00 2001 From: JimMoen Date: Tue, 4 Jun 2024 16:25:22 +0800 Subject: [PATCH] build: run erlfmt with files name by `$(FIND)` --- Makefile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index cbff37ecd..1659f2de1 100644 --- a/Makefile +++ b/Makefile @@ -317,10 +317,16 @@ $(foreach tt,$(ALL_ELIXIR_TGZS),$(eval $(call gen-elixir-tgz-target,$(tt)))) .PHONY: fmt fmt: $(REBAR) - @$(SCRIPTS)/erlfmt -w 'apps/*/{src,include,priv,test,integration_test}/**/*.{erl,hrl,app.src,eterm}' - @$(SCRIPTS)/erlfmt -w 'apps/*/rebar.config' 'apps/emqx/rebar.config.script' '.ci/fvt_tests/http_server/rebar.config' - @$(SCRIPTS)/erlfmt -w 'rebar.config' 'rebar.config.erl' - @$(SCRIPTS)/erlfmt -w 'scripts/*.escript' 'bin/*.escript' 'bin/nodetool' + @$(FIND) . \( -name '*.app.src' -o \ + -name '*.erl' -o \ + -name '*.hrl' -o \ + -name 'rebar.config' -o \ + -name '*.eterm' -o \ + -name '*.escript' \) -not -path '*/_build/*' -type f \ + | xargs $(SCRIPTS)/erlfmt -w + @$(SCRIPTS)/erlfmt -w 'apps/emqx/rebar.config.script' + @$(SCRIPTS)/erlfmt -w 'elvis.config' + @$(SCRIPTS)/erlfmt -w 'bin/nodetool' @mix format .PHONY: clean-test-cluster-config