Add misspell-check

This commit is contained in:
kolaente 2020-09-01 21:54:57 +02:00
parent deeaa13a72
commit ef9dc81da6
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 7 additions and 2 deletions

View File

@ -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() {