From 00d506ba7ccd9c3d44518d39e6e0bc16065fcd98 Mon Sep 17 00:00:00 2001 From: Jannis Mattheis Date: Fri, 30 Mar 2018 19:02:01 +0200 Subject: [PATCH] Add js lint & building to make file --- .travis.yml | 3 +-- Makefile | 12 +++++++++--- ui/package.json | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index b0a6137..9745034 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,9 +32,8 @@ install: script: # packr builds a go file for all packr "boxes", this would be f.ex. the spec.json file. - - (cd ui && npm run build) + - make build-js - packr - - ui/node_modules/.bin/eslint ui/src - make test - make check diff --git a/Makefile b/Makefile index d155282..aafe89f 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ DOCKER_DIR=./docker/ SHELL := /bin/bash test: test-coverage test-race -check: additional-checks check-swagger +check: check-go check-swagger check-js require-version: if [ -n ${VERSION} ] && [[ $$VERSION == "v"* ]]; then echo "The version may not start with v" && exit 1; fi @@ -23,11 +23,14 @@ test-coverage: fi \ done -additional-checks: +check-go: go vet ./... gocyclo -over 10 $(shell find . -iname '*.go' -type f | grep -v /vendor/) golint -set_exit_status $(shell go list ./... | grep -v mock) +check-js: + (cd ui && npm run lint) + download-tools: go get github.com/golang/lint/golint go get github.com/fzipp/gocyclo @@ -66,4 +69,7 @@ build-docker: require-version (cd ${DOCKER_DIR} && docker build -f Dockerfile.arm7 -t gotify/server-arm7:latest -t gotify/server-arm7:${VERSION} .) rm ${DOCKER_DIR}gotify-app -.PHONY: test-race test-coverage test additional-checks verify-swagger check download-tools update-swagger package-zip build-docker \ No newline at end of file +build-js: + (cd ui && npm run build) + +.PHONY: test-race test-coverage test check-go check-js verify-swagger check download-tools update-swagger package-zip build-docker build-js \ No newline at end of file diff --git a/ui/package.json b/ui/package.json index efa405b..a01f0d8 100644 --- a/ui/package.json +++ b/ui/package.json @@ -24,6 +24,7 @@ "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test --env=jsdom", + "lint": "eslint src", "eject": "react-scripts eject" }, "devDependencies": {