diff --git a/bundle/regal/rules/idiomatic/use-if/use_if.rego b/bundle/regal/rules/idiomatic/use-if/use_if.rego index 277506b1..9b33aa54 100644 --- a/bundle/regal/rules/idiomatic/use-if/use_if.rego +++ b/bundle/regal/rules/idiomatic/use-if/use_if.rego @@ -34,5 +34,5 @@ report contains violation if { not startswith(text, "if") - violation := result.fail(rego.metadata.chain(), result.location(rule)) + violation := result.fail(rego.metadata.chain(), result.ranged_from_ref(rule.head.ref)) } diff --git a/bundle/regal/rules/idiomatic/use-if/use_if_test.rego b/bundle/regal/rules/idiomatic/use-if/use_if_test.rego index b5f298ea..1caae9a6 100644 --- a/bundle/regal/rules/idiomatic/use-if/use_if_test.rego +++ b/bundle/regal/rules/idiomatic/use-if/use_if_test.rego @@ -22,8 +22,8 @@ test_fail_should_use_if if { "file": "policy_v0.rego", "row": 3, "end": { - "col": 3, - "row": 7, + "col": 5, + "row": 3, }, "text": "rule := [true |", },