Skip to content

Commit 21f3295

Browse files
RaisinTendanielleadams
authored andcommitted
build: refactor Makefile
* add character classes * replace echo -n with printf Co-authored-by: Antoine du Hamel <[email protected]> PR-URL: #36759 Reviewed-By: Antoine du Hamel <[email protected]>
1 parent 54bd4ab commit 21f3295

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Makefile

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ FLAKY_TESTS ?= run
99
TEST_CI_ARGS ?=
1010
STAGINGSERVER ?= node-www
1111
LOGLEVEL ?= silent
12-
OSTYPE := $(shell uname -s | tr '[A-Z]' '[a-z]')
12+
OSTYPE := $(shell uname -s | tr '[:upper:]' '[:lower:]')
1313
COVTESTS ?= test-cov
1414
COV_SKIP_TESTS ?= core_line_numbers.js,testFinalizer.js,test_function/test.js
1515
GTEST_FILTER ?= "*"
@@ -40,7 +40,7 @@ ifeq ($(OSTYPE), darwin)
4040
GCOV = xcrun llvm-cov gcov
4141
endif
4242

43-
BUILDTYPE_LOWER := $(shell echo $(BUILDTYPE) | tr '[A-Z]' '[a-z]')
43+
BUILDTYPE_LOWER := $(shell echo $(BUILDTYPE) | tr '[:upper:]' '[:lower:]')
4444

4545
# Determine EXEEXT
4646
EXEEXT := $(shell $(PYTHON) -c \
@@ -85,7 +85,7 @@ endif
8585
# To add a target to the help, add a double comment (##) on the target line.
8686
help: ## Print help for targets with comments.
8787
@printf "For more targets and info see the comments in the Makefile.\n\n"
88-
@grep -E '^[a-zA-Z0-9._-]+:.*?## .*$$' Makefile | sort | \
88+
@grep -E '^[[:alnum:]._-]+:.*?## .*$$' Makefile | sort | \
8989
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
9090

9191
# The .PHONY is needed to ensure that we recursively use the out/Makefile
@@ -243,10 +243,10 @@ coverage-test: coverage-build
243243
--gcov-exclude='.*\b(deps|usr|out|cctest|embedding)\b' -v \
244244
-r Release/obj.target --html --html-detail -o ../coverage/cxxcoverage.html \
245245
--gcov-executable="$(GCOV)")
246-
@echo -n "Javascript coverage %: "
246+
@printf "Javascript coverage %%: "
247247
@grep -B1 Lines coverage/index.html | head -n1 \
248248
| sed 's/<[^>]*>//g'| sed 's/ //g'
249-
@echo -n "C++ coverage %: "
249+
@printf "C++ coverage %%: "
250250
@grep -A3 Lines coverage/cxxcoverage.html | grep style \
251251
| sed 's/<[^>]*>//g'| sed 's/ //g'
252252

@@ -1360,7 +1360,7 @@ lint: ## Run JS, C++, MD and doc linters.
13601360
$(MAKE) lint-addon-docs || EXIT_STATUS=$$? ; \
13611361
$(MAKE) lint-md || EXIT_STATUS=$$? ; \
13621362
exit $$EXIT_STATUS
1363-
CONFLICT_RE=^>>>>>>> [0-9A-Fa-f]+|^<<<<<<< [A-Za-z]+
1363+
CONFLICT_RE=^>>>>>>> [[:xdigit:]]+|^<<<<<<< [[:alpha:]]+
13641364

13651365
# Related CI job: node-test-linter
13661366
lint-ci: lint-js-ci lint-cpp lint-py lint-md lint-addon-docs

0 commit comments

Comments
 (0)