Skip to content

Commit

Permalink
Merge pull request #11 from cytopia/ci
Browse files Browse the repository at this point in the history
Add linting stage for CI
  • Loading branch information
cytopia authored Jun 30, 2019
2 parents b8e0498 + b418169 commit 0647e3d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ install:
### Check generation changes, build and test
###
before_script:
- make lint
- while ! make build TAG=${VERSION}; do sleep 1; done
- while ! make test TAG=${VERSION}; do sleep 1; done

Expand Down
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ifneq (,)
.error This Makefile requires GNU Make.
endif

.PHONY: build rebuild test _test_version _test_run tag pull login push enter
.PHONY: build rebuild lint test _test_version _test_run tag pull login push enter

CURRENT_DIR = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))

Expand All @@ -17,6 +17,14 @@ build:
rebuild: pull
docker build --no-cache --build-arg VERSION=$(TAG) -t $(IMAGE) -f $(DIR)/$(FILE) $(DIR)

lint:
@docker run --rm -v $(CURRENT_DIR):/data cytopia/file-lint file-cr --text --ignore '.git/,.github/,tests/' --path .
@docker run --rm -v $(CURRENT_DIR):/data cytopia/file-lint file-crlf --text --ignore '.git/,.github/,tests/' --path .
@docker run --rm -v $(CURRENT_DIR):/data cytopia/file-lint file-trailing-single-newline --text --ignore '.git/,.github/,tests/' --path .
@docker run --rm -v $(CURRENT_DIR):/data cytopia/file-lint file-trailing-space --text --ignore '.git/,.github/,tests/' --path .
@docker run --rm -v $(CURRENT_DIR):/data cytopia/file-lint file-utf8 --text --ignore '.git/,.github/,tests/' --path .
@docker run --rm -v $(CURRENT_DIR):/data cytopia/file-lint file-utf8-bom --text --ignore '.git/,.github/,tests/' --path .

test:
@$(MAKE) --no-print-directory _test_version
@$(MAKE) --no-print-directory _test_run
Expand Down

0 comments on commit 0647e3d

Please sign in to comment.