mirror of
https://github.com/mgechev/revive.git
synced 2025-11-23 22:04:49 +02:00
rule: allow lowercased and kebab-cased options (#1272)
* rule: tests for Configure with named options; fix errors * rule: refactor and add tests for ifelse rules * rule: allow lowercased and kebab-cased options * test: update integration tests with lowercased params * docs: update rules descriptions * rule: simplify Configure implementation with one option * gofmt and fix lint * review: add isRuleOption, update grammar in doc, simplify regex Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com> --------- Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
This commit is contained in:
15
testdata/indent_error_flow_scope.go
vendored
Normal file
15
testdata/indent_error_flow_scope.go
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
package pkg
|
||||
|
||||
func fn4() {
|
||||
if cond {
|
||||
var x = fn2()
|
||||
fn3(x)
|
||||
return
|
||||
} else {
|
||||
y := fn2()
|
||||
fn3(y)
|
||||
}
|
||||
// Don't want to move the declaration of x here since it stays in scope afterward
|
||||
y := fn2()
|
||||
fn3(y)
|
||||
}
|
||||
Reference in New Issue
Block a user