Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

empty-lines false positive as of 1.2.2 #739

Closed
twmb opened this issue Aug 25, 2022 · 1 comment · Fixed by #742
Closed

empty-lines false positive as of 1.2.2 #739

twmb opened this issue Aug 25, 2022 · 1 comment · Fixed by #742
Assignees
Labels

Comments

@twmb
Copy link

twmb commented Aug 25, 2022

Single line functions are flagged as having an erroneous newline at the start and end as of revive 1.2.2.

main.go:

package main

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

config.toml:

[rule.empty-lines]
@m4x3r:~/foo
$ go install github.com/mgechev/revive@v1.2.1

[19:54:35]
@m4x3r:~/foo
$ revive -config config.toml ./...

[19:54:39]
@m4x3r:~/foo
$ go install github.com/mgechev/revive@v1.2.2

[19:54:41]
@m4x3r:~/foo
$ revive -config config.toml ./...
main.go:3:13: extra empty line at the start of a block
main.go:3:13: extra empty line at the end of a block

[19:54:43]
@m4x3r:~/foo
$ go install github.com/mgechev/revive@v1.2.3

[19:54:46]
@m4x3r:~/foo
$ revive -config config.toml ./...
main.go:3:13: extra empty line at the start of a block
main.go:3:13: extra empty line at the end of a block
@cyril1929
Copy link

cyril1929 commented Sep 6, 2022

Shouldn't we create a v1.2.4 tag, to formalize this correction ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants