Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fsamin/nofuncflags
a Go(lang) linter, because flag arguments are ugly
https://github.com/fsamin/nofuncflags
go golang gometalinter linter
Last synced: 30 days ago
JSON representation
a Go(lang) linter, because flag arguments are ugly
- Host: GitHub
- URL: https://github.com/fsamin/nofuncflags
- Owner: fsamin
- License: apache-2.0
- Created: 2018-03-05T20:00:04.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-21T19:38:33.000Z (almost 6 years ago)
- Last Synced: 2024-08-03T17:09:58.136Z (3 months ago)
- Topics: go, golang, gometalinter, linter
- Language: Go
- Homepage:
- Size: 69.3 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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](./doc/screen.png)
## Installation
`go get github.com/fsamin/nofuncflags`
### Usage
Any funcions containing a boolean as argument are extracted.
```shell
nofuncflags [...]
```### Usage with gometalinter
```shell
gometalinter --linter=nofuncflags:nofuncflags:PATH:LINE:COL:MESSAGE --enable=nofuncflags [] [...]
```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
],
```