Giter Club home page Giter Club logo

goword's Introduction

goword

Spell checking and godoc checking for golang comments.

Mechanism

goword uses both a natural language dictionary and a source token dictionary to spell check comments. The source token dictionary avoids flagging acceptable go-style comments (e.g., vim's :set spell will complain about function names).

goword understands godoc formatting and can detect incorrect labels in godoc comments. This is useful for catching when a function, field, or type name drifts from the godoc documentation.

Unlike misspell checkers, goword has few false negatives. On the other hand, goword is more likely to give false positives. Most false positives may be elided by passing goword an ignore list.

Example Output

A misspelled local function:

/usr/lib/go/src/net/addrselect.go.38: // srcsAddrs tries to UDP-connect to each address to see if it has a (godoc-local: srcsAddrs -> srcAddrs?)

A misspelled comment:

/usr/lib/go/src/os/str.go.5: // Simple converions to avoid depending on strconv. (spell: converions -> conversions?)

An exported function drifted to a local function:

/usr/lib/go/src/go/types/conversions.go.11: // Conversion type-checks the conversion T(x). (godoc-local: Conversion -> conversion?)

Should begin with the function identifier:

/usr/lib/go/src/cmd/compile/internal/gc/builtin/unsafe.go.15: // return types here are ignored; see unsafe.go (godoc-export: return -> Offsetof?)

A local function drifted into an export function:

/usr/lib/go/src/internal/trace/parser.go.583: // symbolizeTrace attaches func/file/line info to stack traces. (godoc-export: symbolizeTrace -> Symbolize?)

Requirements

goword links against:

and hence requires the corresponding development headers to build.

Running

From your golang project root,

goword file.go [file2.go, file3.go, ...]

goword's People

Contributors

chzchzchz avatar jonboulle avatar theclapp avatar

Watchers

 avatar  avatar

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.