Skip to content

StevenACoffman/fixer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fixer - Apply All Linter Suggested Fixes at once

go install github.com/StevenACoffman/fixer@latest
fixer -fix ./...

golangci-lint does not currently support applying suggested fixes per golangci/golangci-lint#1779

So this just does that for us. There are a number of Khan-specific linters (written by my co-workers) which can be enabled via -khan, so fixer -khan -fix ./...

Current golangci-linters that support SuggestedFixes:

There's also a few in golang.org/x/tools/go/analysis:

  • assign - Package assign defines an Analyzer that detects useless assignments.
  • fieldaligment - Package fieldalignment defines an Analyzer that detects structs that would use less memory if their fields were sorted.
  • sigchanyzer - check for unbuffered channel of os.Signal
  • sortslice - Package sortslice defines an Analyzer that checks for calls to sort.Slice that do not use a slice type as first argument.
  • stringintconv - Package stringintconv defines an Analyzer that flags type conversions from integers to strings.
  • unreachable - Package unreachable defines an Analyzer that checks for unreachable code.

Currently, this skips findcall and rulesguard which more fiddling to get working.

About

Apply Lint Suggested Fixes

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages