Giter VIP home page Giter VIP logo

lint's People

Contributors

albertbrand avatar favadi avatar gonzaloserrano avatar kingslef avatar nussjustin avatar sridharv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lint's Issues

go vet false positive with input from list of file `*.go`

I have default linter on top of 3 repository and it output false positive go vet error.

~/testlinter/src/meomap] 12s $ go test --run TestLint
--- FAIL: TestLint (2.33s)
        lint_test.go:17: lint failures: govet.Check: /Users/meomap/testlinter/src/meomap/b/main.go:9: declaration of "foo" shadows declaration at /Users/meomap/testlinter/src/meomap/a/main.go:3
FAIL
exit status 1
FAIL    meomap  2.342s

It seems the linter run this go vet command

$ go tool vet --shadow a/main.go b/main.go c/main.go 

and I opened an issue at golang project here but it closed

golang/go#18018

Is there any reason why the vet command have to run with list of *.go file instead of greedy argument . ?

gosimple, gostaticcheck: no option for build tags

To test a package with staticcheck or gosimple, I would need to pass some build tags, as I could do with errcheck:

errcheck.Check{
	Tags: "tag",
},

but gosimple.Check or gostaticcheck.Check do not take any tags as parameters, even though the tools themselves support them:

$ staticcheck --help
Usage of staticcheck:
	staticcheck [flags] # runs on package in current directory
	staticcheck [flags] packages
	staticcheck [flags] directory
	staticcheck [flags] files... # must be a single package
Flags:
  -ignore string
    	Space separated list of checks to ignore, in the following format: 'import/path/file.go:Check1,Check2,...' Both the import path and file name sections support globbing, e.g. 'os/exec/*_test.go'
  -min_confidence float
    	Deprecated; use -ignore instead
  -tags build tags
    	List of build tags

$ gosimple --help
Usage of gosimple:
	gosimple [flags] # runs on package in current directory
	gosimple [flags] packages
	gosimple [flags] directory
	gosimple [flags] files... # must be a single package
Flags:
  -ignore string
    	Space separated list of checks to ignore, in the following format: 'import/path/file.go:Check1,Check2,...' Both the import path and file name sections support globbing, e.g. 'os/exec/*_test.go'
  -min_confidence float
    	Deprecated; use -ignore instead
  -tags build tags
    	List of build tags

Is it just missing implementation or am I missing something?

Add metalinter support

Add it initially with all linters disabled and have users pick the ones they want manually.

Support vendoring linters

As suggested by @fortytw2 in #2, vendoring linters (especially gometalinter) will make it much easier to run this as part of a test suite since no internet access is needed.

Requirements

  • Vendoring will need to be done so that it can be easily overridden if necessary.
  • It should work independently of any package managers.
  • There is no requirement that it use the Go vendoring system

Build failing on Travis but not locally

https://travis-ci.org/surullabs/lint/builds/177229429

--- FAIL: TestGosimple (0.98s)
	testutil.go:55: Check 1 /tmp/gosimpletest794064390/src/gosimpletest/file.go:6:1: expected declaration, found 'IDENT' sfsff
		/tmp/gosimpletest794064390/src/gosimpletest/file.go:4:2: "fmt" imported but not used
		/tmp/gosimpletest794064390/src/gosimpletest/file.go:4:2: "fmt" imported but not used
		2016/11/19 08:38:32 couldn't load packages due to errors: gosimpletest
	testutil.go:55: Check 2 /tmp/gosimpletest512030637/src/gosimpletest/file.go:3:2: "fmt" imported but not used
		/tmp/gosimpletest512030637/src/gosimpletest/file.go:3:2: "fmt" imported but not used
		2016/11/19 08:38:32 couldn't load packages due to errors: gosimpletest
FAIL
coverage: 57.1% of statements in github.com/surullabs/lint/gosimple, github.com/surullabs/lint/checkers
FAIL	github.com/surullabs/lint/gosimple	0.990s
--- FAIL: TestGostaticcheck (0.99s)
	testutil.go:55: Check 1 /tmp/gostaticchecktest241190326/src/gostaticchecktest/file.go:6:1: expected declaration, found 'IDENT' sfsff
		/tmp/gostaticchecktest241190326/src/gostaticchecktest/file.go:4:2: "fmt" imported but not used
		/tmp/gostaticchecktest241190326/src/gostaticchecktest/file.go:4:2: "fmt" imported but not used
		2016/11/19 08:38:35 couldn't load packages due to errors: gostaticchecktest
	testutil.go:55: Check 2 /tmp/gostaticchecktest611298205/src/gostaticchecktest/file.go:3:2: "fmt" imported but not used
		/tmp/gostaticchecktest611298205/src/gostaticchecktest/file.go:3:2: "fmt" imported but not used
		2016/11/19 08:38:35 couldn't load packages due to errors: gostaticchecktest

The change that triggered this error hasn't touched any of the failing packages.

Update paths for staticcheck and gosimple

The paths have been changed:

From https://groups.google.com/forum/#!topic/golang-nuts/fQQiO4OPdmQ


I have consolidated all of my Go tools in one place at
honnef.co/go/tools (backed by github.com/dominikh/go-tools)

This has changed a number of import paths. The command lines for
the tools now live at honnef.co/go/tools/cmd – for example,
staticcheck has moved from
honnef.co/go/staticcheck/cmd/staticcheck to
honnef.co/go/tools/cmd/staticcheck. Similarly, the supporting
libraries have moved to honnef.co/go/tools as well.

In order to make the transition as pain-free as possible, the old
import paths and GitHub repositories will keep working for a
limited time. Concretely, the following deprecation schedule is in
place:

1. Beginning now, the authoritative place for all code, issues
and pull requests is at github.com/dominikh/go-tools. The old
repositories will not receive new features or bug fixes. The old
import paths will – out of necessity – keep pointing to the old
repositories.

2. Starting March 1st, tools installed from the old locations
will unconditionally exit with a non-zero status code and emit a
deprecation warning. They will otherwise keep functioning like
normal.

3. Starting April 1st, all code in the old locations will be
removed and replaced with a single file causing a build failure,
instructing users to use the new location.

I am sorry for the inconvenience this causes. However, developing
all tools in a single repository will have benefits in the long
run and is worth the disruption.

Cheers,
Dominik

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.