From d66fc3c6e3c2aff7ba126d5eacaa3be46186880a Mon Sep 17 00:00:00 2001 From: Tom Gallacher Date: Mon, 31 Oct 2016 14:17:08 +0000 Subject: [PATCH] make: adding lint-ci task Fixes #50 --- Makefile | 2 +- circle.yml | 2 +- cloudapi-graphql/Makefile | 12 +++++++++--- frontend/Makefile | 12 +++++++++--- ui/Makefile | 12 +++++++++--- 5 files changed, 29 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 2a650eec..0a7715ce 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ check: -@./bin/setup SUBDIRS := $(dir $(wildcard */Makefile)) -TARGETS := install clean test test-ci lint # whatever else, but must not contain '/' +TARGETS := install clean test test-ci lint lint-ci # whatever else, but must not contain '/' # foo/.all bar/.all foo/.clean bar/.clean SUBDIRS_TARGETS := \ diff --git a/circle.yml b/circle.yml index 0c65e987..78815b21 100644 --- a/circle.yml +++ b/circle.yml @@ -31,7 +31,7 @@ dependencies: test: override: - - make -j2 lint test-ci + - make -j2 lint-ci test-ci deployment: production: # just a label; label names are completely up to you diff --git a/cloudapi-graphql/Makefile b/cloudapi-graphql/Makefile index 745d775f..e5787eb2 100644 --- a/cloudapi-graphql/Makefile +++ b/cloudapi-graphql/Makefile @@ -21,11 +21,12 @@ test: $(AVA) $(TEST_ARGS) XUNIT_DIR := ${CIRCLE_TEST_REPORTS}/tap-xunit -XUNIT_ARGS := -t | $(bindir)/tap-xunit >> ${CIRCLE_TEST_REPORTS}/tap-xunit/xunit-$(NAME).xml +XUNIT := $(bindir)/tap-xunit +XUNIT_OUTPUT := >> ${CIRCLE_TEST_REPORTS}/tap-xunit/xunit-$(NAME) .PHONY: test-ci test-ci: mkdir -p $(XUNIT_DIR) - $(NYC) $(AVA) $(XUNIT_ARGS) + $(NYC) $(AVA) -t | $(XUNIT) $(XUNIT_OUTPUT).xml .PHONY: start start: @@ -33,4 +34,9 @@ start: .PHONY: lint lint: - @$(shell yarn bin)/eslint src + $(bindir)/eslint . + +.PHONY: lint-ci +lint-ci: + mkdir -p $(XUNIT_DIR) + -$(bindir)/eslint . --format tap | $(XUNIT) $(XUNIT_OUTPUT)-lint.xml diff --git a/frontend/Makefile b/frontend/Makefile index 44d83a5e..5915ab92 100644 --- a/frontend/Makefile +++ b/frontend/Makefile @@ -21,11 +21,12 @@ test: BABEL_DISABLE_CACHE=1 NODE_ENV=test CONFIG=$(shell pwd)/webpack/index.js $(NYC) $(AVA) test/*.js $(TEST_ARGS) XUNIT_DIR := ${CIRCLE_TEST_REPORTS}/tap-xunit -XUNIT_ARGS := -t | $(bindir)/tap-xunit >> ${CIRCLE_TEST_REPORTS}/tap-xunit/xunit-$(NAME).xml +XUNIT := $(bindir)/tap-xunit +XUNIT_OUTPUT := >> ${CIRCLE_TEST_REPORTS}/tap-xunit/xunit-$(NAME) .PHONY: test-ci test-ci: mkdir -p $(XUNIT_DIR) - BABEL_DISABLE_CACHE=1 NODE_ENV=test CONFIG=$(shell pwd)/webpack/index.js $(NYC) $(AVA) test/*.js $(XUNIT_ARGS) + BABEL_DISABLE_CACHE=1 NODE_ENV=test CONFIG=$(shell pwd)/webpack/index.js $(NYC) $(AVA) test/*.js -t | $(XUNIT) $(XUNIT_OUTPUT).xml .PHONY: compile compile: install @@ -37,4 +38,9 @@ start: .PHONY: lint lint: - @$(shell yarn bin)/eslint . + $(bindir)/eslint . + +.PHONY: lint-ci +lint-ci: + mkdir -p $(XUNIT_DIR) + -$(bindir)/eslint . --format tap | $(XUNIT) $(XUNIT_OUTPUT)-lint.xml diff --git a/ui/Makefile b/ui/Makefile index 7e542d27..ec66128b 100644 --- a/ui/Makefile +++ b/ui/Makefile @@ -11,11 +11,12 @@ test: BABEL_DISABLE_CACHE=1 NODE_ENV=test CONFIG=$(shell pwd)/webpack/index.js $(NYC) $(AVA) test/*.js $(TEST_ARGS) XUNIT_DIR := ${CIRCLE_TEST_REPORTS}/tap-xunit -XUNIT_ARGS := -t | $(bindir)/tap-xunit >> ${CIRCLE_TEST_REPORTS}/tap-xunit/xunit-$(NAME).xml +XUNIT := $(bindir)/tap-xunit +XUNIT_OUTPUT := >> ${CIRCLE_TEST_REPORTS}/tap-xunit/xunit-$(NAME) .PHONY: test-ci test-ci: mkdir -p $(XUNIT_DIR) - BABEL_DISABLE_CACHE=1 NODE_ENV=test CONFIG=$(shell pwd)/webpack/index.js $(NYC) $(AVA) test/*.js $(XUNIT_ARGS) + BABEL_DISABLE_CACHE=1 NODE_ENV=test CONFIG=$(shell pwd)/webpack/index.js $(NYC) $(AVA) test/*.js -t | $(XUNIT) $(XUNIT_OUTPUT).xml .PHONY: install-embed-markdown-loader install-embed-markdown-loader: @@ -44,4 +45,9 @@ clean: .PHONY: lint lint: - @$(shell yarn bin)/eslint . + $(bindir)/eslint . + +.PHONY: lint-ci +lint-ci: + mkdir -p $(XUNIT_DIR) + -$(bindir)/eslint . --format tap | $(XUNIT) $(XUNIT_OUTPUT)-lint.xml