gocomplain

package module
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

README

GoComplain

Yum

Go Report Card License

What is this?

This module attempts to combine multiple other Go source analyzing tools. Currently supported functionality includes:

  • Go analyzers
    • go vet
    • gocyclo
    • golint
    • ineffassign
    • staticcheck
  • Go formatting
    • gofmt
    • gofumpt
    • line-length verification
  • Spelling
    • misspell
    • spellcheck

How to install

Open a terminal and run the following:

$ go install --ldflags "-s -w" --trimpath \
    github.com/mjwhitta/gocomplain/cmd/gocomplain@latest

Usage

Run gocomplain -h to see the full usage, but you can safely run gocomplain to get started analyzing, while using the default settings.

Documentation

Index

Constants

View Source
const Version string = "0.8.0"

Version is the package version.

Variables

View Source
var Debug bool

Debug will turn on debug log messages.

View Source
var Quiet bool

Quiet can be used to disable information log messages.

Functions

func FindSrcFiles

func FindSrcFiles(
	search string, prune ...string,
) (map[string][]string, map[string][]string, map[string][]string)

FindSrcFiles will recursively traverse the provided directory and return a list of Go source files.

func GoCyclo

func GoCyclo(over uint) []string

GoCyclo will analyze the provided Go source files for any functions that are overly complex.

func GoFmt

func GoFmt() []string

GoFmt will format and simplify all Go source files.

func GoFumpt

func GoFumpt() []string

GoFumpt will format and optimize all Go source files.

func GoLint

func GoLint(minConf float64) []string

GoLint will lint all packages.

func GoVet

func GoVet(src ...map[string][]string) []string

GoVet will vet all packages.

func IneffAssign

func IneffAssign(src ...map[string][]string) []string

IneffAssign will analyze all packages for any inefficient variable assignments.

func LineLength

func LineLength(threshold uint, src ...map[string][]string) []string

LineLength will analyze the provided Go files for lines that are longer than the provided threshold.

func Misspell added in v0.2.0

func Misspell(ignore []string, src ...map[string][]string) []string

Misspell will look for spelling errors in provided Go source files.

func SpellCheck

func SpellCheck(
	ignore []string, skip []string, src ...map[string][]string,
) []string

SpellCheck will run the appropriate tool for the current OS and check for spelling errors in the provided Go source files.

func StaticCheck

func StaticCheck(src ...map[string][]string) []string

StaticCheck will perform static analysis on all packages.

func UpdateInstall

func UpdateInstall()

UpdateInstall will install the newest versions of the underlying tools.

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