Golangci-lint: Support identypo

Created on 6 Aug 2018  路  7Comments  路  Source: golangci/golangci-lint

Currently the misspell spell checker only checks go code (using ReplaceGo)

Unfortunately it doesn't provide feature parity with simply using misspell.

I suggest either adding a config option to use Replace instead, or just use Replace so that it provides the same features as just using misspell.

Happy to provide a PR once a solution is decided.

Please include the following information:

  1. Version of golangci-lint: 1.9.3
  2. Go environment: go version go1.10.3 darwin/amd64
help wanted new

Most helpful comment

@sagikazarmark if you are looking for a workaround (you could probably define a custom linter or something or the like), I've wrote a tool that parses the Go AST and looks for typos in constants, variables, functions, etc. It calls misspell's Replace: https://github.com/alexkohler/identypo/blob/master/identifier_typo.go#L97

All 7 comments

Ping :)

@sagikazarmark if you are looking for a workaround (you could probably define a custom linter or something or the like), I've wrote a tool that parses the Go AST and looks for typos in constants, variables, functions, etc. It calls misspell's Replace: https://github.com/alexkohler/identypo/blob/master/identifier_typo.go#L97

@sagikazarmark would you like to search typos in constants and func names or to search types in txt,md and other types of files?

As the comment says:

// ReplaceGo is a specialized routine for correcting Golang source
// files.  Currently only checks comments, not identifiers for
// spelling.

So yeah, I'd like to search typos in identifiers and I think it'd be nice if golangci supported it.

ok, got it

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Bump

Was this page helpful?
0 / 5 - 0 ratings