-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
43 lines (33 loc) · 1.99 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
ifneq (,)
.error This Makefile requires GNU Make.
endif
.PHONY: lint _lint-files _pull-fl
CURRENT_DIR = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
# -------------------------------------------------------------------------------------------------
# file-lint settings
# -------------------------------------------------------------------------------------------------
FL_VERSION = latest
FL_IGNORE_PATHS = .git/,.github/
# -------------------------------------------------------------------------------------------------
# Default target
# -------------------------------------------------------------------------------------------------
help:
@echo "help Show this help screen"
@echo "lint Static source code analysis"
# -------------------------------------------------------------------------------------------------
# Standard targets
# -------------------------------------------------------------------------------------------------
lint:
@$(MAKE) --no-print-directory _lint-files
# -------------------------------------------------------------------------------------------------
# Helper Targets
# -------------------------------------------------------------------------------------------------
_lint-files: _pull-fl
@docker run --rm -v $(CURRENT_DIR):/data cytopia/file-lint file-cr --text --ignore '$(FL_IGNORE_PATHS)' --path .
@docker run --rm -v $(CURRENT_DIR):/data cytopia/file-lint file-crlf --text --ignore '$(FL_IGNORE_PATHS)' --path .
@docker run --rm -v $(CURRENT_DIR):/data cytopia/file-lint file-trailing-single-newline --text --ignore '$(FL_IGNORE_PATHS)' --path .
@docker run --rm -v $(CURRENT_DIR):/data cytopia/file-lint file-trailing-space --text --ignore '$(FL_IGNORE_PATHS)' --path .
@docker run --rm -v $(CURRENT_DIR):/data cytopia/file-lint file-utf8 --text --ignore '$(FL_IGNORE_PATHS)' --path .
@docker run --rm -v $(CURRENT_DIR):/data cytopia/file-lint file-utf8-bom --text --ignore '$(FL_IGNORE_PATHS)' --path .
_pull-fl:
docker pull cytopia/file-lint:$(FL_VERSION)