Giter Site home page Giter Site logo

Comments (7)

client9 avatar client9 commented on June 15, 2024

I'll attempt to add this to gometalinter

from goreportcard.

dmitshur avatar dmitshur commented on June 15, 2024

That would be really nice to see! 👍

from goreportcard.

client9 avatar client9 commented on June 15, 2024

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.

from goreportcard.

shawnps avatar shawnps commented on June 15, 2024

@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.

from goreportcard.

shawnps avatar shawnps commented on June 15, 2024

(Not sure if getting misspell into gometalinter would fix this)

from goreportcard.

shawnps avatar shawnps commented on June 15, 2024

I think I got it.

[]string{"gometalinter", "--deadline=180s", "--disable-all", "--linter", "misspell:misspell ./*.go:PATH:LINE:MESSAGE", "--enable=misspell"}

from goreportcard.

shawnps avatar shawnps commented on June 15, 2024

This is in now with 0 weight. Added a couple of issues and a PR to misspell:

client9/misspell#10
client9/misspell#7
client9/misspell#8

from goreportcard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.