Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change 'go tool vet' to 'go vet' #1548

Merged
merged 3 commits into from Mar 8, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -7732,7 +7732,7 @@ See URL `https://github.com/golang/lint'."
go-build go-test go-errcheck go-unconvert go-megacheck))

(flycheck-def-option-var flycheck-go-vet-print-functions nil go-vet
"A list of print-like functions for `go tool vet'.
"A list of print-like functions for `go vet'.

Go vet will check these functions for format string problems and
issues, such as a mismatch between the number of formats used,
@@ -7748,18 +7748,6 @@ take an io.Writer as their first argument, like Fprintf,
(string :tag "function"))
:safe #'flycheck-string-list-p)

(flycheck-def-option-var flycheck-go-vet-shadow nil go-vet
This conversation was marked as resolved by vincekd

This comment has been minimized.

Copy link
@fmdkdd

fmdkdd Mar 6, 2019

Member

You'll need to remove the option from the documentation in doc/languages.rst.

"Whether to check for shadowed variables with `go tool vet'.

When non-nil check for shadowed variables. When `strict' check
more strictly, which can very noisy. When nil do not check for
shadowed variables.

This option requires Go 1.6 or newer."
:type '(choice (const :tag "Do not check for shadowed variables" nil)
(const :tag "Check for shadowed variables" t)
(const :tag "Strictly check for shadowed variables" strict)))

(flycheck-def-option-var flycheck-go-megacheck-disabled-checkers nil
go-megacheck
"A list of checkers to disable when running `megacheck'.
@@ -7774,24 +7762,24 @@ enabled. "
:safe #'flycheck-string-list-p)

(flycheck-define-checker go-vet
"A Go syntax checker using the `go tool vet' command.
"A Go syntax checker using the `go vet' command.

See URL `https://golang.org/cmd/go/' and URL
`https://golang.org/cmd/vet/'."
:command ("go" "tool" "vet" "-all"
(option "-printfuncs=" flycheck-go-vet-print-functions concat
:command ("go" "vet"
(option "-printf.funcs=" flycheck-go-vet-print-functions concat
flycheck-option-comma-separated-list)
(option-flag "-shadow" flycheck-go-vet-shadow)
(option-list "-tags=" flycheck-go-build-tags concat)
(eval (when (eq flycheck-go-vet-shadow 'strict) "-shadowstrict"))
;; (option-flag "-shadow" flycheck-go-vet-shadow) ;; DEPRECATED
This conversation was marked as resolved by vincekd

This comment has been minimized.

Copy link
@fmdkdd

fmdkdd Mar 6, 2019

Member

You can remove these outright, no need to to leave dead code in comments.

;; (option-list "-tags=" flycheck-go-build-tags concat) ;; DEPRECATED
;; (eval (when (eq flycheck-go-vet-shadow 'strict) "-shadowstrict")) ;; DEPRECATED
source)
:error-patterns
((warning line-start (file-name) ":" line ": " (message) line-end))
:modes go-mode
;; We must explicitly check whether the "vet" tool is available
;; We must explicitly check whether the "vet" command is available
This conversation was marked as resolved by vincekd

This comment has been minimized.

Copy link
@fmdkdd

fmdkdd Mar 6, 2019

Member

I thought go vet was always present as long as go was installed?

This comment has been minimized.

Copy link
@vincekd

vincekd Mar 6, 2019

Author Contributor

Unless your go package is broken, I guess.

Should I remove it or just leave it in as a check that go is install properly?

This comment has been minimized.

Copy link
@fmdkdd

fmdkdd Mar 6, 2019

Member

We already checks the :command part exists, you can remove the :predicate and :verify which are redundant then.

:predicate (lambda ()
(let ((go (flycheck-checker-executable 'go-vet)))
(member "vet" (ignore-errors (process-lines go "tool")))))
(ignore-errors (process-lines go "help" "vet"))))
:next-checkers (go-build
go-test
;; Fall back if `go build' or `go test' can be used
@@ -7800,11 +7788,10 @@ See URL `https://golang.org/cmd/go/' and URL
go-megacheck)
:verify (lambda (_)
(let* ((go (flycheck-checker-executable 'go-vet))
(have-vet (member "vet" (ignore-errors
(process-lines go "tool")))))
(have-vet (ignore-errors (process-lines go "help" "vet"))))
(list
(flycheck-verification-result-new
:label "go tool vet"
:label "go vet"
:message (if have-vet "present" "missing")
:face (if have-vet 'success '(bold error)))))))

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.