Skip to content

Is there any linter can check missing a blank line between functions? #2946

Closed Answered by bombsimon
ppd0705 asked this question in Q&A
Discussion options

You must be logged in to vote

gofumpt has the rule "Multiline top-level declarations must be separated by empty lines" which affects functions at top level scope. It will change

func foo() {
	println("multiline foo")
}
func bar() {
	println("multiline bar")
}

To

func foo() {
	println("multiline foo")
}

func bar() {
	println("multiline bar")
}

wsl has the rule "Expressions should not be cuddled with blocks" although WSL does not have an auto fixer like gofumpt and it's also not possible to only enable this check in WSL.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ppd0705
Comment options

Answer selected by ppd0705
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants