tools/cmd/vet: Sort checks list alphabetically.
The existing list of checks in doc.go has become somewhat unwieldy. This commit is purely cosmetic and sorts the list alphabetically keyed by the flag name. Change-Id: Ibb56357f9d4667d199acc6637dc28f6e17903046 Reviewed-on: https://go-review.googlesource.com/14558 Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
parent
871b75fbfc
commit
c262de870b
124
cmd/vet/doc.go
124
cmd/vet/doc.go
|
@ -37,49 +37,6 @@ except the printf check.
|
||||||
|
|
||||||
Available checks:
|
Available checks:
|
||||||
|
|
||||||
Printf family
|
|
||||||
|
|
||||||
Flag: -printf
|
|
||||||
|
|
||||||
Suspicious calls to functions in the Printf family, including any functions
|
|
||||||
with these names, disregarding case:
|
|
||||||
Print Printf Println
|
|
||||||
Fprint Fprintf Fprintln
|
|
||||||
Sprint Sprintf Sprintln
|
|
||||||
Error Errorf
|
|
||||||
Fatal Fatalf
|
|
||||||
Log Logf
|
|
||||||
Panic Panicf Panicln
|
|
||||||
If the function name ends with an 'f', the function is assumed to take
|
|
||||||
a format descriptor string in the manner of fmt.Printf. If not, vet
|
|
||||||
complains about arguments that look like format descriptor strings.
|
|
||||||
|
|
||||||
It also checks for errors such as using a Writer as the first argument of
|
|
||||||
Printf.
|
|
||||||
|
|
||||||
Methods
|
|
||||||
|
|
||||||
Flag: -methods
|
|
||||||
|
|
||||||
Non-standard signatures for methods with familiar names, including:
|
|
||||||
Format GobEncode GobDecode MarshalJSON MarshalXML
|
|
||||||
Peek ReadByte ReadFrom ReadRune Scan Seek
|
|
||||||
UnmarshalJSON UnreadByte UnreadRune WriteByte
|
|
||||||
WriteTo
|
|
||||||
|
|
||||||
Struct tags
|
|
||||||
|
|
||||||
Flag: -structtags
|
|
||||||
|
|
||||||
Struct tags that do not follow the format understood by reflect.StructTag.Get.
|
|
||||||
Well-known encoding struct tags (json, xml) used with unexported fields.
|
|
||||||
|
|
||||||
Unkeyed composite literals
|
|
||||||
|
|
||||||
Flag: -composites
|
|
||||||
|
|
||||||
Composite struct literals that do not use the field-keyed syntax.
|
|
||||||
|
|
||||||
Assembly declarations
|
Assembly declarations
|
||||||
|
|
||||||
Flag: -asmdecl
|
Flag: -asmdecl
|
||||||
|
@ -110,36 +67,92 @@ Flag: -buildtags
|
||||||
|
|
||||||
Badly formed or misplaced +build tags.
|
Badly formed or misplaced +build tags.
|
||||||
|
|
||||||
|
Unkeyed composite literals
|
||||||
|
|
||||||
|
Flag: -composites
|
||||||
|
|
||||||
|
Composite struct literals that do not use the field-keyed syntax.
|
||||||
|
|
||||||
Copying locks
|
Copying locks
|
||||||
|
|
||||||
Flag: -copylocks
|
Flag: -copylocks
|
||||||
|
|
||||||
Locks that are erroneously passed by value.
|
Locks that are erroneously passed by value.
|
||||||
|
|
||||||
|
Documentation examples
|
||||||
|
|
||||||
|
Flag: -example
|
||||||
|
|
||||||
|
Mistakes involving example tests, including examples with incorrect names or
|
||||||
|
function signatures, or that document identifiers not in the package.
|
||||||
|
|
||||||
|
Methods
|
||||||
|
|
||||||
|
Flag: -methods
|
||||||
|
|
||||||
|
Non-standard signatures for methods with familiar names, including:
|
||||||
|
Format GobEncode GobDecode MarshalJSON MarshalXML
|
||||||
|
Peek ReadByte ReadFrom ReadRune Scan Seek
|
||||||
|
UnmarshalJSON UnreadByte UnreadRune WriteByte
|
||||||
|
WriteTo
|
||||||
|
|
||||||
Nil function comparison
|
Nil function comparison
|
||||||
|
|
||||||
Flag: -nilfunc
|
Flag: -nilfunc
|
||||||
|
|
||||||
Comparisons between functions and nil.
|
Comparisons between functions and nil.
|
||||||
|
|
||||||
|
Printf family
|
||||||
|
|
||||||
|
Flag: -printf
|
||||||
|
|
||||||
|
Suspicious calls to functions in the Printf family, including any functions
|
||||||
|
with these names, disregarding case:
|
||||||
|
Print Printf Println
|
||||||
|
Fprint Fprintf Fprintln
|
||||||
|
Sprint Sprintf Sprintln
|
||||||
|
Error Errorf
|
||||||
|
Fatal Fatalf
|
||||||
|
Log Logf
|
||||||
|
Panic Panicf Panicln
|
||||||
|
If the function name ends with an 'f', the function is assumed to take
|
||||||
|
a format descriptor string in the manner of fmt.Printf. If not, vet
|
||||||
|
complains about arguments that look like format descriptor strings.
|
||||||
|
|
||||||
|
It also checks for errors such as using a Writer as the first argument of
|
||||||
|
Printf.
|
||||||
|
|
||||||
Range loop variables
|
Range loop variables
|
||||||
|
|
||||||
Flag: -rangeloops
|
Flag: -rangeloops
|
||||||
|
|
||||||
Incorrect uses of range loop variables in closures.
|
Incorrect uses of range loop variables in closures.
|
||||||
|
|
||||||
Unreachable code
|
|
||||||
|
|
||||||
Flag: -unreachable
|
|
||||||
|
|
||||||
Unreachable code.
|
|
||||||
|
|
||||||
Shadowed variables
|
Shadowed variables
|
||||||
|
|
||||||
Flag: -shadow=false (experimental; must be set explicitly)
|
Flag: -shadow=false (experimental; must be set explicitly)
|
||||||
|
|
||||||
Variables that may have been unintentionally shadowed.
|
Variables that may have been unintentionally shadowed.
|
||||||
|
|
||||||
|
Shifts
|
||||||
|
|
||||||
|
Flag: -shift
|
||||||
|
|
||||||
|
Shifts equal to or longer than the variable's length.
|
||||||
|
|
||||||
|
Struct tags
|
||||||
|
|
||||||
|
Flag: -structtags
|
||||||
|
|
||||||
|
Struct tags that do not follow the format understood by reflect.StructTag.Get.
|
||||||
|
Well-known encoding struct tags (json, xml) used with unexported fields.
|
||||||
|
|
||||||
|
Unreachable code
|
||||||
|
|
||||||
|
Flag: -unreachable
|
||||||
|
|
||||||
|
Unreachable code.
|
||||||
|
|
||||||
Misuse of unsafe Pointers
|
Misuse of unsafe Pointers
|
||||||
|
|
||||||
Flag: -unsafeptr
|
Flag: -unsafeptr
|
||||||
|
@ -159,19 +172,6 @@ discarded. By default, this includes functions like fmt.Errorf and
|
||||||
fmt.Sprintf and methods like String and Error. The flags -unusedfuncs
|
fmt.Sprintf and methods like String and Error. The flags -unusedfuncs
|
||||||
and -unusedstringmethods control the set.
|
and -unusedstringmethods control the set.
|
||||||
|
|
||||||
Shifts
|
|
||||||
|
|
||||||
Flag: -shift
|
|
||||||
|
|
||||||
Shifts equal to or longer than the variable's length.
|
|
||||||
|
|
||||||
Documentation examples
|
|
||||||
|
|
||||||
Flag: -example
|
|
||||||
|
|
||||||
Mistakes involving example tests, including examples with incorrect names or
|
|
||||||
function signatures, or that document identifiers not in the package.
|
|
||||||
|
|
||||||
Other flags
|
Other flags
|
||||||
|
|
||||||
These flags configure the behavior of vet:
|
These flags configure the behavior of vet:
|
||||||
|
|
Loading…
Reference in New Issue