-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
go/analysis: harmonize flags across all checkers
The -json and -c=N flags, formerly belonging only to the go/packages-based {single,multi}checkers, are now supported by unitchecker as well. The no-op -source, -v, -all, and -tags flags, formerly belonging only to unitchecker, have moved to the analysisflags package, which is common to all checkers. The -flags flag now reports all registered flags (except the {single,multi}checker-only debugging flags) rather than just those related to analyzers, allowing one to say: 'go vet -json' or 'go vet -c=1'. The code for printing diagnostics, either plain or in JSON, has been factored and moved into the common analysisflags package. This CL depends on https://go-review.googlesource.com/c/go/+/149960 to cmd/go, which causes 'go vet' to populate the ID field of the *.cfg. This field is used as a key in the JSON tree. Added basic tests of the new -json and -c unitchecker flags. Change-Id: Ia7a3a9adc86de067de060732d2c200c58be3945a Reviewed-on: https://go-review.googlesource.com/c/150038 Reviewed-by: Michael Matloob <matloob@golang.org>
- Loading branch information
Showing
5 changed files
with
197 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.