noyoda

package module
v0.0.0-...-069b760 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: MIT Imports: 6 Imported by: 0

README

noyoda is a Go linter, which reports yoda style conditionals.

Flags

Flag Description Default
-fix Auto fix yoda conditions no
-include-const Treat const as literal (const x = 10; if x == a) no
-skip-range Skip number range checks (10 > a && a > 5) yes

Installation and Usage

go install github.com/eugercek/noyoda/cmd/noyoda
cd mycode # go to your code's main package
noyoda ./...

Roadmap

  • if check
  • switch check
  • const check
  • Flag for const
  • Recursive check
  • Auto fix
  • Skip number range checks (10 > a && a > 10...)
  • Run tests for comprehensive set of popular go codebases, if there are many maybe Open a PR to golangci-lint

Useful Resources

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAnalyzer

func NewAnalyzer() *analysis.Analyzer

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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