Closed client9 closed 8 years ago
I'll attempt to add this to gometalinter
That would be really nice to see! :+1:
hi @shurcooL in the meantime.. you can manually use it with gometalinter See https://github.com/client9/misspell#does-this-work-with-gometalinter for details.
@client9 thanks, I'm looking at this now. I can't get the stdout for whatever reason. I made a small script to try to figure it out:
package main
import (
"bufio"
"fmt"
"log"
"os/exec"
"syscall"
)
func main() {
dir := "/Users/shawn/mygo/src/github.com/gojp/goreportcard/repos/src/github.com/ugorji/go"
command := []string{"gometalinter", "--deadline=180s", "--disable-all", "--linter='misspell:misspell ./*.go:PATH:LINE:MESSAGE'", "--enable=misspell"}
params := command[1:]
params = append(params, dir+"/...")
cmd := exec.Command(command[0], params...)
stdout, err := cmd.StdoutPipe()
if err != nil {
log.Fatal(err)
}
err = cmd.Start()
if err != nil {
log.Fatal(err)
}
out := bufio.NewScanner(stdout)
for out.Scan() {
fmt.Println(out.Text())
}
if err := out.Err(); err != nil {
log.Fatal(err)
}
err = cmd.Wait()
if exitErr, ok := err.(*exec.ExitError); ok {
// The program has exited with an exit code != 0
if status, ok := exitErr.Sys().(syscall.WaitStatus); ok {
// some commands exit 1 when files fail to pass (for example go vet)
if status.ExitStatus() != 1 {
log.Fatal(err)
}
}
}
}
it prints nothing, but if I run the command manually I get a bunch of results. Not sure if something in there is glaringly wrong.
(Not sure if getting misspell
into gometalinter
would fix this)
I think I got it.
[]string{"gometalinter", "--deadline=180s", "--disable-all", "--linter", "misspell:misspell ./*.go:PATH:LINE:MESSAGE", "--enable=misspell"}
This is in now with 0 weight. Added a couple of issues and a PR to misspell:
https://github.com/client9/misspell/pull/10 https://github.com/client9/misspell/issues/7 https://github.com/client9/misspell/issues/8
Not sure I would give or deduct points, but nice to see.
https://github.com/client9/misspell