-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
58 lines (50 loc) · 1.8 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
###############################################################################
# Linters (not normally run manually via command line, but here for backup.)
###############################################################################
.PHONY: lint lint-style lint-style-fix lint-code
lint: lint-style lint-code
lint-code: lint-code-js
lint-style: lint-style-js lint-style-scala ## Lint all files for code style
lint-style-fix: lint-style-js-fix lint-style-scala-fix # Automatically fix all files for code style
lint-style-js:
npm run style
lint-style-js-fix:
npm run style:fix
lint-code-js:
npm run lint
lint-code-js-fix:
npm run lint:fix
SCALAFMT_IMAGE = mrothy/scalafmt-native:2.3.2
SCALAFMT_TARGETS = src project build.sbt
SCALAFMT_EXCLUSIONS = target/
lint-style-scala: # Lint scala files for code style
docker run \
-v $$(PWD):/src \
--rm -it \
--workdir /src \
$(SCALAFMT_IMAGE) \
--exclude $(SCALAFMT_EXCLUSIONS) \
--list \
$(SCALAFMT_TARGETS)
lint-style-scala-fix: # Automatically fix scala files for code style
docker run \
-v $$(PWD):/src \
--rm -it \
--workdir /src \
$(SCALAFMT_IMAGE) \
--exclude $(SCALAFMT_EXCLUSIONS) \
$(SCALAFMT_TARGETS)
###############################################################################
# Modified version of self-documenting help script from:
# https://suva.sh/posts/well-documented-makefiles/
#
# This creates a default `help` goal that will document all tasks that are
# annotated with a double comment "#" marker.
###############################################################################
.DEFAULT_GOAL:=help
help: ## Display this help message
@awk 'BEGIN { \
FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\nTargets:\n" \
} /^[a-zA-Z0-9_-]+:.*?##/ { \
printf " \033[36m%-12s\033[0m %s\n", $$1, $$2 \
}' $(MAKEFILE_LIST)