Help us shape the future of Go! Take the 2026 Go Developer Survey

nosnakecase

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: MIT Imports: 7 Imported by: 4

README

nosnakecase

nosnakecase is a linter that detects snake case of variable naming and function name.

Instruction

go install github.com/sivchari/nosnakecase/cmd/nosnakecase@latest

Usage

package sandbox

func a_() {
}

func b(a_a int) {
}

func c() (c_c int) {
    c_c = 1
	return c_c
}

func d() {
	var d_d int
	_ = d_d // It's never detected, because `_` is meaningful in Go and `d_d` is already detected.
}
go vet -vettool=(which nosnakecase) ./...

# command-line-arguments
./main.go:3:6: a_ is used under score. You should use mixedCap or MixedCap.
./main.go:6:8: a_a is used under score. You should use mixedCap or MixedCap.
./main.go:10:2: c_c is used under score. You should use mixedCap or MixedCap.
./main.go:11:9: c_c is used under score. You should use mixedCap or MixedCap.
./main.go:9:11: c_c is used under score. You should use mixedCap or MixedCap.
./main.go:15:6: d_d is used under score. You should use mixedCap or MixedCap.

CI

CircleCI
- run:
    name: install nosnakecase
    command: go install github.com/sivchari/nosnakecase/cmd/nosnakecase@latest

- run:
    name: run nosnakecase
    command: go vet -vettool=`which nosnakecase` ./...
GitHub Actions
- name: install nosnakecase
  run: go install github.com/sivchari/nosnakecase/cmd/nosnakecase@latest

- name: run nosnakecase
  run: go vet -vettool=`which nosnakecase` ./...

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name: "nosnakecase",
	Doc:  doc,
	Run:  run,
	Requires: []*analysis.Analyzer{
		inspect.Analyzer,
	},
}

Analyzer is a nosnakecase linter.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd
nosnakecase command

Jump to

Keyboard shortcuts

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