You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This one was particularly bad before, as only the last character on
the line would indicate an issue, making it really hard to see. Now
we flag the whole line.
Signed-off-by: Anders Eknert <anders@styra.com>
Copy file name to clipboardexpand all lines: bundle/regal/rules/style/line_length_test.rego
+12-5
Original file line number
Diff line number
Diff line change
@@ -20,8 +20,11 @@ foo == bar; bar == baz; [a, b, c, d, e, f] := [1, 2, 3, 4, 5, 6]; qux := [q | so
20
20
}],
21
21
"title": "line-length",
22
22
"location": {
23
-
"col": 103, "file": "policy.rego", "row": 6,
23
+
"col": 1,
24
+
"file": "policy.rego",
25
+
"row": 6,
24
26
"text": `foo == bar; bar == baz; [a, b, c, d, e, f] := [1, 2, 3, 4, 5, 6]; qux := [q | some q in input.nonsense]`,
27
+
"end": {"col": 103, "row": 6},
25
28
},
26
29
"level": "error",
27
30
}}
@@ -50,9 +53,11 @@ test_fail_line_too_long_but_below_breakable_word_threshold if {
50
53
"description": "Line too long",
51
54
"level": "error",
52
55
"location": {
53
-
"col": 56,
56
+
"col": 1,
54
57
"file": "policy.rego",
55
-
"row": 7, "text": "\t# Long url: https://www.example.com/this/is/a/very/long",
58
+
"row": 7,
59
+
"text": "\t# Long url: https://www.example.com/this/is/a/very/long",
60
+
"end": {"col": 56, "row": 7},
56
61
},
57
62
"related_resources": [{
58
63
"description": "documentation",
@@ -73,10 +78,12 @@ test_fail_line_exceeds_120_characters_even_if_not_in_config if {
73
78
"description": "Line too long",
74
79
"level": "error",
75
80
"location": {
76
-
"col": 147,
81
+
"col": 1,
77
82
"file": "policy.rego",
83
+
"row": 5,
78
84
# regal ignore:line-length
79
-
"row": 5, "text": "# Long url: https://www.example.com/this/is/a/very/long/url/that/cannot/be/shortened/and/should/trigger/an/error/anyway/so/that/it/can/be/shortened",
85
+
"text": "# Long url: https://www.example.com/this/is/a/very/long/url/that/cannot/be/shortened/and/should/trigger/an/error/anyway/so/that/it/can/be/shortened",
0 commit comments