nofuncflags

command module
v0.0.0-...-16474e2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

README

Golang nofuncflags linter

« Flag arguments are ugly. Passing a boolean into a function is a truly terrible practice. It immediately complicates the signature of the method, loudly proclaiming that this function does more than one thing. It does one thing if the flag is true and another if the flag is false! »

Clean Code - Robert C. Martin

VSC Preview

Installation

go get github.com/fsamin/nofuncflags

Usage

Any funcions containing a boolean as argument are extracted.

nofuncflags [<path>...]
Usage with gometalinter
gometalinter --linter=nofuncflags:nofuncflags:PATH:LINE:COL:MESSAGE --enable=nofuncflags [<flags>] [<path>...]

Usage with Visual Studio Code To use nofuncflags with VS Code you need to have Go Meta Linter installed, then add following to your User Settings (Ctrl+,)

"go.lintTool": "gometalinter",
"go.lintFlags": [
  "--disable-all", // Disable all linters
  "--linter=nofuncflags:nofuncflags:PATH:LINE:COL:MESSAGE",
  "--enable=nofuncflags",
  "--enable=golint", // Enable any other linters you want to use
],

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL