From 5c2e6e9f5a177a3d5706a3485f8d9a1ec9a91d0c Mon Sep 17 00:00:00 2001 From: golangci Date: Sun, 13 May 2018 19:11:01 +0300 Subject: [PATCH] .travis.yml and don't use internal package --- .travis.yml | 6 ++++++ Makefile | 1 + cmd/golangci-lint/main.go | 2 +- {internal => pkg}/commands/executor.go | 0 {internal => pkg}/commands/linters.go | 0 {internal => pkg}/commands/root.go | 0 {internal => pkg}/commands/run.go | 0 pkg/testdata/with_issues/deadcode.go | 4 ++-- pkg/testdata/with_issues/structcheck.go | 4 ++-- pkg/testdata/with_issues/varcheck.go | 2 +- 10 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 .travis.yml rename {internal => pkg}/commands/executor.go (100%) rename {internal => pkg}/commands/linters.go (100%) rename {internal => pkg}/commands/root.go (100%) rename {internal => pkg}/commands/run.go (100%) diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000000..cf6a248fdb17 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +sudo: false +language: go +go: + - 1.9.x + - 1.10.x +script: make test diff --git a/Makefile b/Makefile index bbb549a2c7a9..f2241e886d67 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,4 @@ test: + go install ./cmd/... golangci-lint run go test -v -race ./... diff --git a/cmd/golangci-lint/main.go b/cmd/golangci-lint/main.go index a13fcc2491aa..6ec42e0c15ce 100644 --- a/cmd/golangci-lint/main.go +++ b/cmd/golangci-lint/main.go @@ -3,7 +3,7 @@ package main import ( "log" - "github.com/golangci/golangci-lint/internal/commands" + "github.com/golangci/golangci-lint/pkg/commands" "github.com/sirupsen/logrus" ) diff --git a/internal/commands/executor.go b/pkg/commands/executor.go similarity index 100% rename from internal/commands/executor.go rename to pkg/commands/executor.go diff --git a/internal/commands/linters.go b/pkg/commands/linters.go similarity index 100% rename from internal/commands/linters.go rename to pkg/commands/linters.go diff --git a/internal/commands/root.go b/pkg/commands/root.go similarity index 100% rename from internal/commands/root.go rename to pkg/commands/root.go diff --git a/internal/commands/run.go b/pkg/commands/run.go similarity index 100% rename from internal/commands/run.go rename to pkg/commands/run.go diff --git a/pkg/testdata/with_issues/deadcode.go b/pkg/testdata/with_issues/deadcode.go index a239496ffb70..ffa7c1d7052a 100644 --- a/pkg/testdata/with_issues/deadcode.go +++ b/pkg/testdata/with_issues/deadcode.go @@ -2,12 +2,12 @@ package testdata var y int -var unused int // ERROR "`unused` is unused" +var unused int // nolint:megacheck // ERROR "`unused` is unused" func f(x int) { } -func g(x int) { // ERROR "`g` is unused" +func g(x int) { // nolint:megacheck // ERROR "`g` is unused" } func H(x int) { diff --git a/pkg/testdata/with_issues/structcheck.go b/pkg/testdata/with_issues/structcheck.go index e0162c83d820..3e1f35ea6630 100644 --- a/pkg/testdata/with_issues/structcheck.go +++ b/pkg/testdata/with_issues/structcheck.go @@ -1,5 +1,5 @@ package testdata -type t struct { // ERROR "`t` is unused" - unusedField int // ERROR "`unusedField` is unused" +type t struct { // nolint:megacheck // ERROR "`t` is unused" + unusedField int // nolint:megacheck // ERROR "`unusedField` is unused" } diff --git a/pkg/testdata/with_issues/varcheck.go b/pkg/testdata/with_issues/varcheck.go index e1651849ef56..914dd7b66378 100644 --- a/pkg/testdata/with_issues/varcheck.go +++ b/pkg/testdata/with_issues/varcheck.go @@ -1,3 +1,3 @@ package testdata -var v string // ERROR "`v` is unused" +var v string // nolint:megacheck // ERROR "`v` is unused"