Skip to content

Go linter to analyze expression groups: require 'import', 'const', 'var' and/or 'type' declaration groups

License

Notifications You must be signed in to change notification settings

leonklingele/grouper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grouper — a Go linter to analyze expression groups

Installation

go install github.com/leonklingele/grouper@latest
grouper -help

Run analyzer

grouper -import-require-single-import -import-require-grouping ./...

# Example output:
GOPATH/src/github.com/leonklingele/grouper/pkg/analyzer/analyzer.go:8:1: should only use a single 'import' declaration, 2 found
GOPATH/src/github.com/leonklingele/grouper/pkg/analyzer/flags.go:3:1: should only use grouped 'import' declarations

Available flags

  -const-require-grouping
    	require the use of grouped global 'const' declarations
  -const-require-single-const
    	require the use of a single global 'const' declaration only

  -import-require-grouping
    	require the use of grouped 'import' declarations
  -import-require-single-import
    	require the use of a single 'import' declaration only

  -type-require-grouping
    	require the use of grouped global 'type' declarations
  -type-require-single-type
    	require the use of a single global 'type' declaration only

  -var-require-grouping
    	require the use of grouped global 'var' declarations
  -var-require-single-var
    	require the use of a single global 'var' declaration only

About

Go linter to analyze expression groups: require 'import', 'const', 'var' and/or 'type' declaration groups

Resources

License

Stars

Watchers

Forks

Packages

No packages published