Skip to content

Commit

Permalink
Remove vendor and linting tasks
Browse files Browse the repository at this point in the history
Linting should be decoupled from any library or repository. It is a tool
that not affected the build, but help on detect bugs or analyze code.
  • Loading branch information
shuLhan committed May 19, 2018
1 parent 7080193 commit b71e071
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 102 deletions.
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
.lint.out
cover.html
cover.out
go-bindata/cover.out
go-bindata/go-bindata
/cmd/go-bindata/cover.out
/cmd/go-bindata/go-bindata
lib.cover.out
testdata/out/
vendor
47 changes: 3 additions & 44 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
##

.PHONY: all build
.PHONY: lint lint-all
.PHONY: test coverbrowse test-cmd
.PHONY: clean distclean

Expand Down Expand Up @@ -52,13 +51,6 @@ TEST_OUT := \
VENDOR_DIR :=$(PWD)/vendor
VENDOR_BIN :=$(VENDOR_DIR)/bin

LINTER_OUT :=.lint.out
LINTER_CMD :=$(VENDOR_BIN)/gometalinter
LINTER_OPTS =\
--vendor --concurrency=1 --deadline=240s --enable-gc --sort=path \
--skip=testdata \
--disable=gotype
LINTER =GOBIN=$(VENDOR_BIN) $(VENDOR_BIN)/gometalinter $(LINTER_OPTS)

##
## MAIN TARGET
Expand All @@ -71,33 +63,11 @@ all: build test-cmd
##

clean:
rm -rf $(TEST_COVER_OUT) $(TEST_COVER_HTML) $(TESTDATA_OUT_DIR) \
$(LINTER_OUT)
rm -rf $(TEST_COVER_OUT) $(TEST_COVER_HTML) $(TESTDATA_OUT_DIR)

distclean: clean
rm -rf $(TARGET_CMD) $(TARGET_LIB) $(VENDOR_DIR)

##
## LINT
##

$(VENDOR_DIR): vendor.deps
@echo ">>> Installing vendor dependencies ..."
@./scripts/deps.sh $<
@touch $@

$(LINTER_CMD): $(VENDOR_DIR)

$(LINTER_OUT): $(LINTER_CMD) $(CMD_SRC) $(CMD_TEST) $(LIB_SRC) $(LIB_TEST)
@echo ">>> Linting ..."
-$(LINTER) ./... > $@

lint: $(LINTER_OUT)
@cat $<

lint-all: LINTER_OPTS+=--enable-all --disable=gotype --disable=nakedret
lint-all: $(LINTER_OUT)
@cat $<

##
## TEST
Expand Down Expand Up @@ -127,7 +97,7 @@ $(TEST_COVER_HTML): $(TEST_COVER_ALL)
@echo ">>> Generate HTML coverage '$@' ..."
@go tool cover -html=$< -o $@

test: lint $(TEST_COVER_HTML)
test: $(TEST_COVER_HTML)

coverbrowse: test
@xdg-open $(TEST_COVER_HTML)
Expand Down Expand Up @@ -160,7 +130,6 @@ $(TESTDATA_OUT_DIR)/opt/no-output/bindata.go: $(TESTDATA_IN_DIR)/*
-ignore="split/" ../../../../$(TESTDATA_IN_DIR)/...
cp ./assert_test.go $(OUT_DIR)
cp $(TESTDATA_DIR)/_bindata_test.go $(OUT_DIR)/bindata_test.go
$(LINTER) $(OUT_DIR)
go test -v $(OUT_DIR)

$(TESTDATA_OUT_DIR)/compress/memcopy/bindata.go: OUT_DIR=$(TESTDATA_OUT_DIR)/compress/memcopy
Expand All @@ -172,7 +141,6 @@ $(TESTDATA_OUT_DIR)/compress/memcopy/bindata.go: $(TESTDATA_IN_DIR)/*
-ignore="split/" $(TESTDATA_IN_DIR)/...
cp ./assert_test.go $(OUT_DIR)
cp $(TESTDATA_DIR)/_bindata_test.go $(OUT_DIR)/bindata_test.go
$(LINTER) $(OUT_DIR)
go test -v $(OUT_DIR)

$(TESTDATA_OUT_DIR)/default/single/bindata.go: OUT_DIR=$(TESTDATA_OUT_DIR)/default/single
Expand All @@ -184,7 +152,6 @@ $(TESTDATA_OUT_DIR)/default/single/bindata.go: $(TESTDATA_IN_DIR)/*
-ignore="split/" $(TESTDATA_IN_DIR)/test.asset
cp ./assert_test.go $(OUT_DIR)
cp $(TESTDATA_DIR)/_out_default_single.go $(OUT_DIR)/bindata_test.go
$(LINTER) $(OUT_DIR) || rm -f $(OUT_DIR)/*
go test -v $(OUT_DIR) || rm -f $(OUT_DIR)/*

$(TESTDATA_OUT_DIR)/compress/nomemcopy/bindata.go: OUT_DIR=$(TESTDATA_OUT_DIR)/compress/nomemcopy
Expand All @@ -196,7 +163,6 @@ $(TESTDATA_OUT_DIR)/compress/nomemcopy/bindata.go: $(TESTDATA_IN_DIR)/*
-ignore="split/" -nomemcopy $(TESTDATA_IN_DIR)/...
cp ./assert_test.go $(OUT_DIR)
cp $(TESTDATA_DIR)/_bindata_test.go $(OUT_DIR)/bindata_test.go
$(LINTER) $(OUT_DIR)
go test -v $(OUT_DIR)

$(TESTDATA_OUT_DIR)/debug/bindata.go: OUT_DIR=$(TESTDATA_OUT_DIR)/debug
Expand All @@ -208,7 +174,6 @@ $(TESTDATA_OUT_DIR)/debug/bindata.go: $(TESTDATA_IN_DIR)/*
-ignore="split/" -debug $(TESTDATA_IN_DIR)/...
cp ./assert_test.go $(OUT_DIR)
cp $(TESTDATA_DIR)/_bindata_test.go $(OUT_DIR)/bindata_test.go
$(LINTER) $(OUT_DIR)
go test -v $(OUT_DIR)

$(TESTDATA_OUT_DIR)/nocompress/memcopy/bindata.go: OUT_DIR=$(TESTDATA_OUT_DIR)/nocompress/memcopy
Expand All @@ -220,7 +185,6 @@ $(TESTDATA_OUT_DIR)/nocompress/memcopy/bindata.go: $(TESTDATA_IN_DIR)/*
-ignore="split/" -nocompress $(TESTDATA_IN_DIR)/...
cp ./assert_test.go $(OUT_DIR)
cp $(TESTDATA_DIR)/_bindata_test.go $(OUT_DIR)/bindata_test.go
$(LINTER) $(OUT_DIR)
go test -v $(OUT_DIR)

$(TESTDATA_OUT_DIR)/nocompress/nomemcopy/bindata.go: OUT_DIR=$(TESTDATA_OUT_DIR)/nocompress/nomemcopy
Expand All @@ -232,7 +196,6 @@ $(TESTDATA_OUT_DIR)/nocompress/nomemcopy/bindata.go: $(TESTDATA_IN_DIR)/*
-ignore="split/" -nocompress -nomemcopy $(TESTDATA_IN_DIR)/...
cp ./assert_test.go $(OUT_DIR)
cp $(TESTDATA_DIR)/_bindata_test.go $(OUT_DIR)/bindata_test.go
$(LINTER) $(OUT_DIR)
go test -v $(OUT_DIR)

$(TESTDATA_OUT_DIR)/split/bindata.go: OUT_DIR=$(TESTDATA_OUT_DIR)/split
Expand All @@ -245,7 +208,6 @@ $(TESTDATA_OUT_DIR)/split/bindata.go: $(TESTDATA_DIR)/_split_test.go $(TESTDATA_
-split $(TESTDATA_IN_DIR)/split/...
cp ./assert_test.go $(OUT_DIR)
cp $< $(OUT_DIR)/bindata_test.go
$(LINTER) $(OUT_DIR)
go test -v $(OUT_DIR)

$(TESTDATA_OUT_DIR)/symlinkFile/bindata.go: OUT_DIR=$(TESTDATA_OUT_DIR)/symlinkFile
Expand All @@ -258,7 +220,6 @@ $(TESTDATA_OUT_DIR)/symlinkFile/bindata.go: $(TESTDATA_DIR)/symlinkFile $(TESTDA
$(TESTDATA_DIR)/symlinkFile/...
cp ./assert_test.go $(OUT_DIR)
cp $(TESTDATA_DIR)/_symlinkFile_test.go $(OUT_DIR)/bindata_test.go
$(LINTER) $(OUT_DIR)
go test -v $(OUT_DIR)

$(TESTDATA_OUT_DIR)/symlinkParent/bindata.go: OUT_DIR=$(TESTDATA_OUT_DIR)/symlinkParent
Expand All @@ -271,7 +232,6 @@ $(TESTDATA_OUT_DIR)/symlinkParent/bindata.go: $(TESTDATA_DIR)/_symlinkParent_tes
$(TESTDATA_DIR)/symlinkParent/...
cp ./assert_test.go $(OUT_DIR)
cp $< $(OUT_DIR)/bindata_test.go
$(LINTER) $(OUT_DIR)
go test -v $(OUT_DIR)

$(TESTDATA_OUT_DIR)/symlinkRecursiveParent/bindata.go: OUT_DIR=$(TESTDATA_OUT_DIR)/symlinkRecursiveParent
Expand All @@ -284,9 +244,8 @@ $(TESTDATA_OUT_DIR)/symlinkRecursiveParent/bindata.go: $(TESTDATA_DIR)/_symlinkR
$(TESTDATA_DIR)/symlinkRecursiveParent/...
cp ./assert_test.go $(OUT_DIR)
cp $< $(OUT_DIR)/bindata_test.go
$(LINTER) $(OUT_DIR)
go test -v $(OUT_DIR)

$(TEST_OUT): $(LINTER_CMD) $(TARGET_CMD) $(POST_TEST_FILES)
$(TEST_OUT): $(TARGET_CMD) $(POST_TEST_FILES)

test-cmd: $(TEST_OUT)
43 changes: 0 additions & 43 deletions scripts/deps.sh

This file was deleted.

11 changes: 0 additions & 11 deletions vendor.deps

This file was deleted.

0 comments on commit b71e071

Please sign in to comment.