Add misspell-check
This commit is contained in:
parent
deeaa13a72
commit
ef9dc81da6
|
@ -57,6 +57,7 @@ var (
|
|||
"fmt-check": FmtCheck,
|
||||
"do-the-swag": DoTheSwag,
|
||||
"got-swag": GotSwag,
|
||||
"misspell-check": MisspellCheck,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -134,7 +135,9 @@ func setGoFiles() {
|
|||
os.Exit(1)
|
||||
}
|
||||
for _, f := range strings.Split(string(files), "\n") {
|
||||
GoFiles = append(GoFiles, RootPath+strings.TrimLeft(f, "."))
|
||||
if strings.HasSuffix(f, ".go") {
|
||||
GoFiles = append(GoFiles, RootPath+strings.TrimLeft(f, "."))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -309,8 +312,10 @@ func GotSwag() {
|
|||
}
|
||||
}
|
||||
|
||||
// Checks the source code for misspellings
|
||||
func MisspellCheck() {
|
||||
|
||||
checkAndInstallGoTool("misspell", "github.com/client9/misspell/cmd/misspell")
|
||||
runAndStreamOutput("misspell", append([]string{"-error"}, GoFiles...)...)
|
||||
}
|
||||
|
||||
func IneffassignCheck() {
|
||||
|
|
Loading…
Reference in New Issue