Repository: MarketSquare/robotframework-robocop
Pull request #1274 (2025-03-02 17:15:20)

Add tests for extended view for spacing rules


Patch:
diff --git a/src/robocop/linter/reports/print_issues.py b/src/robocop/linter/reports/print_issues.py
index edd04ae..f44cac1 100644
--- a/src/robocop/linter/reports/print_issues.py
+++ b/src/robocop/linter/reports/print_issues.py
@@ -149,7 +149,7 @@ class PrintIssuesReport(robocop.linter.reports.Report):
             indent = ""
         else:
             indent = "  "
-        self.console.print(self._gutter(" ", gutter_width, indent))
+        self.console.print(self._gutter(" ", gutter_width, ""))
         # code before issue
         if start_line >= 2 and lines[start_line - 2].strip():  # no empty lines before
             for line_no in range(start_line - 2, start_line):
@@ -175,7 +175,7 @@ class PrintIssuesReport(robocop.linter.reports.Report):
             if line_no > len(lines) or not lines[line_no - 1].strip():
                 break
             self._print_line(f"{self._gutter(line_no, gutter_width, indent)} {escape(lines[line_no - 1])}")
-        self.console.print(self._gutter(" ", gutter_width, indent))
+        self.console.print(self._gutter(" ", gutter_width, ""))
         print()
 
     def print_diagnostics_extended(self) -> None:
diff --git a/src/robocop/linter/rules/spacing.py b/src/robocop/linter/rules/spacing.py
index bfd4b8b..0cbf5ad 100644
--- a/src/robocop/linter/rules/spacing.py
+++ b/src/robocop/linter/rules/spacing.py
@@ -206,6 +206,7 @@ class MixedTabsAndSpacesRule(Rule):
     name = "mixed-tabs-and-spaces"
     rule_id = "SPC06"
     message = "Inconsistent use of tabs and spaces in file"
+    file_wide_rule = True
     severity = RuleSeverity.WARNING
     added_in_version = "1.1.0"
 
@@ -298,6 +299,7 @@ class TooManyTrailingBlankLinesRule(Rule):
     name = "too-many-trailing-blank-lines"
     rule_id = "SPC10"
     message = "Too many blank lines at the end of file"
+    file_wide_rule = True  # TODO: improve checking to report on trailing lines
     severity = RuleSeverity.WARNING
     added_in_version = "1.4.0"
 
@@ -627,7 +629,13 @@ class InvalidSpacingChecker(RawFileChecker):  # TODO merge, we can just use sing
 
         stripped_line = line.rstrip("\n\r")
         if stripped_line and stripped_line[-1] in [" ", "\t"]:
-            self.report(self.trailing_whitespace, lineno=lineno, col=len(stripped_line))
+            whitespace_length = len(stripped_line) - len(stripped_line.rstrip())
+            self.report(
+                self.trailing_whitespace,
+                lineno=lineno,
+                col=len(stripped_line) - whitespace_length + 1,
+                end_col=len(stripped_line) + 1,
+            )
 
 
 class EmptyLinesChecker(VisitorChecker):
@@ -725,13 +733,13 @@ class EmptyLinesChecker(VisitorChecker):
                 continue
             empty_lines = self.check_empty_lines_in_keyword_test(child)
             if allowed_empty_lines not in (empty_lines, -1) and index < last_index:
+                lineno = min(child.end_lineno - empty_lines + 1, child.end_lineno)
                 self.report(
                     rule,
                     empty_lines=empty_lines,
                     allowed_empty_lines=allowed_empty_lines,
-                    lineno=child.end_lineno,
-                    end_lineno=child.end_lineno + 1,
-                    end_col=len(child.name) + 1,
+                    lineno=lineno,
+                    end_lineno=child.end_lineno,
                 )
         self.generic_visit(node)
 


Test patch:
diff --git a/tests/linter/rules/lengths/too_many_arguments/expected_extended.txt b/tests/linter/rules/lengths/too_many_arguments/expected_extended.txt
index 3dd9e1b..ca330c5 100644
--- a/tests/linter/rules/lengths/too_many_arguments/expected_extended.txt
+++ b/tests/linter/rules/lengths/too_many_arguments/expected_extended.txt
@@ -9,7 +9,7 @@ test.robot:17:5 LEN07 Keyword 'Keyword With Too Many Arguments' has too many arg
     |
 
 test.robot:25:5 LEN07 Keyword 'Keyword With Too Many Arguments In Multi Lines' has too many arguments (6/5)
-    |  
+    |
  23 |   Keyword With Too Many Arguments In Multi Lines
  24 |       [Documentation]  this is doc
  25 | /     [Arguments]  ${var1}  @{var2}
@@ -18,5 +18,5 @@ test.robot:25:5 LEN07 Keyword 'Keyword With Too Many Arguments In Multi Lines' h
     | |_^ LEN07
  28 |       No Operation
  29 |       Pass
-    |  
+    |
 
diff --git a/tests/linter/rules/misc/multiline_inline_if/expected_extended.txt b/tests/linter/rules/misc/multiline_inline_if/expected_extended.txt
index c356144..12008de 100644
--- a/tests/linter/rules/misc/multiline_inline_if/expected_extended.txt
+++ b/tests/linter/rules/misc/multiline_inline_if/expected_extended.txt
@@ -1,5 +1,5 @@
 test.robot:4:5 MISC11 Inline IF split to multiple lines
-   |  
+   |
  2 |   My Test Case
  3 |       IF  ${condition}    Log  hello     ELSE    Log  hi!
  4 | /     IF  ${condition}  Log  hello
@@ -7,10 +7,10 @@ test.robot:4:5 MISC11 Inline IF split to multiple lines
    | |_^ MISC11
  6 |       IF  ${condition}
  7 |           Log  hello
-   |  
+   |
 
 test.robot:11:5 MISC11 Inline IF split to multiple lines
-    |  
+    |
   9 |           Log  hi!
  10 |       END
  11 | /     IF  ${condition}
@@ -20,19 +20,19 @@ test.robot:11:5 MISC11 Inline IF split to multiple lines
     | |_^ MISC11
  15 |       Log    something
  16 |       IF  ${condition}
-    |  
+    |
 
 test.robot:16:5 MISC11 Inline IF split to multiple lines
-    |  
+    |
  14 |       ...  Log  hi!
  15 |       Log    something
  16 | /     IF  ${condition}
  17 | |     ...  Log  hello  ELSE  Log  hi!
     | |_^ MISC11
-    |  
+    |
 
 test.robot:23:5 MISC11 Inline IF split to multiple lines
-    |  
+    |
  21 |   My Keyword
  22 |       IF  ${condition}    Log  hello     ELSE    Log  hi!
  23 | /     IF  ${condition}  Log  hello
@@ -40,10 +40,10 @@ test.robot:23:5 MISC11 Inline IF split to multiple lines
     | |_^ MISC11
  25 |       IF  ${condition}
  26 |           Log  hello
-    |  
+    |
 
 test.robot:30:5 MISC11 Inline IF split to multiple lines
-    |  
+    |
  28 |           Log  hi!
  29 |       END
  30 | /     IF  ${condition}
@@ -53,14 +53,14 @@ test.robot:30:5 MISC11 Inline IF split to multiple lines
     | |_^ MISC11
  34 |       Log    something
  35 |       IF  ${condition}
-    |  
+    |
 
 test.robot:35:5 MISC11 Inline IF split to multiple lines
-    |  
+    |
  33 |       ...  Log  hi!
  34 |       Log    something
  35 | /     IF  ${condition}
  36 | |     ...  Log  hello  ELSE  Log  hi!
     | |_^ MISC11
-    |  
+    |
 
diff --git a/tests/linter/rules/spacing/bad_block_indent/expected_extended.txt b/tests/linter/rules/spacing/bad_block_indent/expected_extended.txt
new file mode 100644
index 0000000..b5f6304
--- /dev/null
+++ b/tests/linter/rules/spacing/bad_block_indent/expected_extended.txt
@@ -0,0 +1,75 @@
+comments.robot:32:1 SPC17 Not enough indentation inside block
+    |
+ 30 |     FOR    ${var}  IN   1  2
+ 31 |         Keyword
+ 32 | # invalid comment
+    | ^ SPC17
+ 33 |     END
+    |
+
+comments.robot:47:1 SPC17 Not enough indentation inside block
+    |
+ 45 |     FOR    ${var}  IN   1  2
+ 46 |         Keyword
+ 47 | # invalid comment
+    | ^ SPC17
+ 48 |     END
+    |
+
+test.robot:20:1 SPC17 Not enough indentation inside block
+    |
+ 18 |     Keyword Call
+ 19 |     FOR    ${var}    IN    RANGE    10
+ 20 |    No Operation
+    | ^^^ SPC17
+ 21 |     Bad Indent
+ 22 |       FOR    ${var}    IN    a    b
+    |
+
+test.robot:21:1 SPC17 Not enough indentation inside block
+    |
+ 19 |     FOR    ${var}    IN    RANGE    10
+ 20 |    No Operation
+ 21 |     Bad Indent
+    | ^^^^ SPC17
+ 22 |       FOR    ${var}    IN    a    b
+ 23 |             No Operation
+    |
+
+test.robot:47:1 SPC17 Not enough indentation inside block
+    |
+ 45 |         # comment
+ 46 |         No Operation
+ 47 | # comment
+    | ^ SPC17
+ 48 |         # comment
+ 49 |     END
+    |
+
+test.robot:81:1 SPC17 Not enough indentation inside block
+    |
+ 79 |         No Operation
+ 80 |          No Operation
+ 81 |     No Operation
+    | ^^^^ SPC17
+ 82 |     END
+    |
+
+test.robot:116:1 SPC17 Not enough indentation inside block
+     |
+ 114 | Keyword With Under Indented For Loop Body
+ 115 |     FOR  ${elem}  IN  ${list}
+ 116 |    Log  stuff
+     | ^^^ SPC17
+ 117 |     END
+     |
+
+test.robot:123:1 SPC17 Not enough indentation inside block
+     |
+ 121 |     FOR    ${var}  IN   1  2
+ 122 |         Keyword
+ 123 | # invalid comment
+     | ^ SPC17
+ 124 |     END
+     |
+
diff --git a/tests/linter/rules/spacing/bad_block_indent/test_rule.py b/tests/linter/rules/spacing/bad_block_indent/test_rule.py
index 5606695..baa34e2 100644
--- a/tests/linter/rules/spacing/bad_block_indent/test_rule.py
+++ b/tests/linter/rules/spacing/bad_block_indent/test_rule.py
@@ -14,3 +14,11 @@ class TestRuleAcceptance(RuleAcceptance):
 
     def test_groups(self):
         self.check_rule(src_files=["groups.robot"], expected_file="expected_groups.txt", test_on_version=">=7.2")
+
+    def test_extended(self):
+        self.check_rule(
+            src_files=["comments.robot", "test.robot"],
+            expected_file="expected_extended.txt",
+            output_format="extended",
+            test_on_version=">=5",
+        )
diff --git a/tests/linter/rules/spacing/bad_indent/expected_extended.txt b/tests/linter/rules/spacing/bad_indent/expected_extended.txt
new file mode 100644
index 0000000..c776215
--- /dev/null
+++ b/tests/linter/rules/spacing/bad_indent/expected_extended.txt
@@ -0,0 +1,315 @@
+bug375.robot:7:1 SPC08 Line is under-indented
+   |
+ 5 | *** Test Case ***
+ 6 | My templated test
+ 7 |     [Documentation]    This test is templated
+   | ^^^^ SPC08
+ 8 |     [Template]         Some Template
+ 9 |                        10     arg2
+   |
+
+bug375.robot:8:1 SPC08 Line is under-indented
+   |
+ 6 | My templated test
+ 7 |     [Documentation]    This test is templated
+ 8 |     [Template]         Some Template
+   | ^^^^ SPC08
+ 9 |                        10     arg2
+10 |                        20     arg3
+   |
+
+bug375.robot:23:1 SPC08 Line is over-indented
+    |
+ 21 | My templated test3
+ 22 |     [Documentation]    This test is templated
+ 23 |       [Template]         Some Template
+    | ^^^^^^ SPC08
+ 24 |     10     arg2
+ 25 |     20     arg3
+    |
+
+bug375.robot:33:1 SPC08 Line is under-indented
+    |
+ 31 |     [Template]         Some Template
+ 32 |     10     arg2
+ 33 |    20     arg3
+    | ^^^ SPC08
+ 34 |     -30    arg4
+    |
+
+comments.robot:19:1 SPC08 Line is over-indented
+    |
+ 17 | *** Test Cases ***
+ 18 | # valid comment
+ 19 |   # invalid comment
+    | ^^ SPC08
+ 20 | Test1
+ 21 |     Keyword
+    |
+
+comments.robot:23:1 SPC08 Line is under-indented
+    |
+ 21 |     Keyword
+ 22 |     # comment
+ 23 |    # invalid comment
+    | ^^^ SPC08
+    |
+
+comments.robot:26:1 SPC08 Line is over-indented
+    |
+ 24 |
+ 25 | # comment
+ 26 |     # now also invalid
+    | ^^^^ SPC08
+    |
+
+comments.robot:39:1 SPC08 Line is under-indented
+    |
+ 37 |     Keyword
+ 38 |     # comment
+ 39 |    # invalid comment
+    | ^^^ SPC08
+    |
+
+comments.robot:56:1 SPC08 Line is under-indented
+    |
+ 54 | Keyword With Last Uneven Comment
+ 55 |     No Operation
+ 56 |    # comment
+    | ^^^ SPC08
+    |
+
+comments.robot:60:1 SPC08 Line is under-indented
+    |
+ 58 | Keyword With Comment At 0 Index In The Middle
+ 59 |     Keyword
+ 60 | # comment
+    | ^ SPC08
+ 61 |     Keyword
+ 62 |     # comment
+    |
+
+test.robot:23:1 SPC08 Line is under-indented
+    |
+ 21 |     Bad Indent
+ 22 |       FOR    ${var}    IN    a    b
+ 23 |             No Operation
+    | ^^^^^^^^^^^^ SPC08
+ 24 |              But Unmatched
+ 25 |              With Others
+    |
+
+test.robot:28:1 SPC08 Line is under-indented
+    |
+ 26 |                ...  Should Be Ignored
+ 27 |              # valid comment
+ 28 |             # invalid - not counted to indent count, but reported if it breaks rule
+    | ^^^^^^^^^^^^ SPC08
+ 29 |             # invalid - same as above
+ 30 |       END
+    |
+
+test.robot:29:1 SPC08 Line is under-indented
+    |
+ 27 |              # valid comment
+ 28 |             # invalid - not counted to indent count, but reported if it breaks rule
+ 29 |             # invalid - same as above
+    | ^^^^^^^^^^^^ SPC08
+ 30 |       END
+ 31 |       ${assign}    Keyword Call    b
+    |
+
+test.robot:43:1 SPC08 Line is over-indented
+    |
+ 41 |         ${assign}    IF    $condition    Set Variable    1    ELSE IF    $other_condition    Keyword
+ 42 |         ...    ${a}
+ 43 |          No Operation
+    | ^^^^^^^^^ SPC08
+ 44 |      ELSE
+ 45 |         # comment
+    |
+
+test.robot:44:1 SPC08 Line is over-indented
+    |
+ 42 |         ...    ${a}
+ 43 |          No Operation
+ 44 |      ELSE
+    | ^^^^^ SPC08
+ 45 |         # comment
+ 46 |         No Operation
+    |
+
+test.robot:53:1 SPC08 Line is over-indented
+    |
+ 51 | Test with WHILE
+ 52 |     WHILE    $condition
+ 53 |          WHILE    $condition
+    | ^^^^^^^^^ SPC08
+ 54 |            No Operation
+ 55 |            No Operation
+    |
+
+test.robot:58:1 SPC08 Line is over-indented
+    |
+ 56 |            BREAK
+ 57 |            CONTINUE
+ 58 |          END
+    | ^^^^^^^^^ SPC08
+ 59 |         No Operation
+ 60 |         No Operation
+    |
+
+test.robot:66:1 SPC08 Line is over-indented
+    |
+ 64 | Test With TRY
+ 65 |     No Operation
+ 66 |      TRY
+    | ^^^^^ SPC08
+ 67 |         No Operation
+ 68 |          No Operation
+    |
+
+test.robot:68:1 SPC08 Line is over-indented
+    |
+ 66 |      TRY
+ 67 |         No Operation
+ 68 |          No Operation
+    | ^^^^^^^^^ SPC08
+ 69 |         No Operation
+ 70 |     EXCEPT    *
+    |
+
+test.robot:72:1 SPC08 Line is over-indented
+    |
+ 70 |     EXCEPT    *
+ 71 |         No Operation
+ 72 |          No Operation
+    | ^^^^^^^^^ SPC08
+ 73 |         No Operation
+ 74 |     ELSE
+    |
+
+test.robot:75:1 SPC08 Line is over-indented
+    |
+ 73 |         No Operation
+ 74 |     ELSE
+ 75 |              No Operation
+    | ^^^^^^^^^^^^^ SPC08
+ 76 |              No Operation
+ 77 |              No Operation
+    |
+
+test.robot:76:1 SPC08 Line is over-indented
+    |
+ 74 |     ELSE
+ 75 |              No Operation
+ 76 |              No Operation
+    | ^^^^^^^^^^^^^ SPC08
+ 77 |              No Operation
+ 78 |     FINALLY
+    |
+
+test.robot:77:1 SPC08 Line is over-indented
+    |
+ 75 |              No Operation
+ 76 |              No Operation
+ 77 |              No Operation
+    | ^^^^^^^^^^^^^ SPC08
+ 78 |     FINALLY
+ 79 |         No Operation
+    |
+
+test.robot:80:1 SPC08 Line is over-indented
+    |
+ 78 |     FINALLY
+ 79 |         No Operation
+ 80 |          No Operation
+    | ^^^^^^^^^ SPC08
+ 81 |     No Operation
+ 82 |     END
+    |
+
+test.robot:87:1 SPC08 Line is over-indented
+    |
+ 85 |     [Documentation]  doc
+ 86 |     [Template]  Some Template
+ 87 |                 Over Indent
+    | ^^^^^^^^^^^^^^^^ SPC08
+ 88 |                 ...  Same Here
+ 89 |     What Goes
+    |
+
+test.robot:90:1 SPC08 Line is over-indented
+    |
+ 88 |                 ...  Same Here
+ 89 |     What Goes
+ 90 |      [Teardown]  Over Indented
+    | ^^^^^ SPC08
+    |
+
+test.robot:106:1 SPC08 Line is over-indented
+     |
+ 104 |     IF    ${condition}
+ 105 |         ${value}    Correct Indent
+ 106 |           ${arg}  Incorrect Indent
+     | ^^^^^^^^^^ SPC08
+ 107 |     ELSE IF  ${flag}
+ 108 |          Incorrect Indent
+     |
+
+test.robot:108:1 SPC08 Line is over-indented
+     |
+ 106 |           ${arg}  Incorrect Indent
+ 107 |     ELSE IF  ${flag}
+ 108 |          Incorrect Indent
+     | ^^^^^^^^^ SPC08
+ 109 |         Correct Indent
+ 110 |     ELSE
+     |
+
+test.robot:154:1 SPC08 Line is under-indented
+     |
+ 152 | Bad Comment Indent
+ 153 |     Keyword Call
+ 154 |    # comment
+     | ^^^ SPC08
+ 155 |     FOR  ${var}  IN  1  2
+ 156 |          # comment
+     |
+
+test.robot:156:1 SPC08 Line is over-indented
+     |
+ 154 |    # comment
+ 155 |     FOR  ${var}  IN  1  2
+ 156 |          # comment
+     | ^^^^^^^^^ SPC08
+ 157 |         IF    ${var}
+ 158 |            # comment
+     |
+
+test.robot:158:1 SPC08 Line is under-indented
+     |
+ 156 |          # comment
+ 157 |         IF    ${var}
+ 158 |            # comment
+     | ^^^^^^^^^^^ SPC08
+ 159 |             IF    $condition    RETURN
+ 160 |             Keyword Call    ${var}
+     |
+
+test.robot:162:1 SPC08 Line is over-indented
+     |
+ 160 |             Keyword Call    ${var}
+ 161 |              ...    misaligned but different rule
+ 162 |              # comment
+     | ^^^^^^^^^^^^^ SPC08
+ 163 |         END
+ 164 |     END
+     |
+
+test.robot:169:1 SPC08 Line is over-indented
+     |
+ 169 |   # invalid
+     | ^^ SPC08
+     |
+
diff --git a/tests/linter/rules/spacing/bad_indent/test_rule.py b/tests/linter/rules/spacing/bad_indent/test_rule.py
index ffd0e1f..22daa8e 100644
--- a/tests/linter/rules/spacing/bad_indent/test_rule.py
+++ b/tests/linter/rules/spacing/bad_indent/test_rule.py
@@ -26,6 +26,14 @@ class TestRuleAcceptance(RuleAcceptance):
             test_on_version=test_on_version,
         )
 
+    def test_extended(self):
+        self.check_rule(
+            src_files=["bug375.robot", "comments.robot", "test.robot"],
+            expected_file="expected_extended.txt",
+            output_format="extended",
+            test_on_version=">=5",
+        )
+
     def test_758_bug(self):
         self.check_rule(
             configure=["bad-indent.indent=-1"],
diff --git a/tests/linter/rules/spacing/consecutive_empty_lines/expected_extended.txt b/tests/linter/rules/spacing/consecutive_empty_lines/expected_extended.txt
new file mode 100644
index 0000000..c471893
--- /dev/null
+++ b/tests/linter/rules/spacing/consecutive_empty_lines/expected_extended.txt
@@ -0,0 +1,42 @@
+test.robot:5:1 SPC12 Too many consecutive empty lines (2/1)
+   |
+ 3 |
+ 4 |   Test Template    Keyword
+ 5 | /
+ 6 | |
+   | |_^ SPC12
+ 7 |   Test Timeout    1 min
+   |
+
+test.robot:15:1 SPC12 Too many consecutive empty lines (2/1)
+    |
+ 13 |
+ 14 |   ${var}    1
+ 15 | /
+ 16 | |
+    | |_^ SPC12
+ 17 |   @{var2}    1
+ 18 |   ...       2
+    |
+
+test.robot:29:1 SPC12 Too many consecutive empty lines (2/1)
+    |
+ 27 |
+ 28 |       Keyword
+ 29 | /
+ 30 | |
+    | |_^ SPC12
+ 31 |       Keyword
+    |
+
+test.robot:46:1 SPC12 Too many consecutive empty lines (3/1)
+    |
+ 44 |
+ 45 |       Keyword
+ 46 | /
+ 47 | |
+ 48 | |
+    | |_^ SPC12
+ 49 |       Keyword
+    |
+
diff --git a/tests/linter/rules/spacing/consecutive_empty_lines/test_rule.py b/tests/linter/rules/spacing/consecutive_empty_lines/test_rule.py
index 325f6bc..8cc5ebf 100644
--- a/tests/linter/rules/spacing/consecutive_empty_lines/test_rule.py
+++ b/tests/linter/rules/spacing/consecutive_empty_lines/test_rule.py
@@ -5,6 +5,9 @@ class TestRuleAcceptance(RuleAcceptance):
     def test_rule(self):
         self.check_rule(expected_file="expected_output.txt")
 
+    def test_extended(self):
+        self.check_rule(src_files=["test.robot"], expected_file="expected_extended.txt", output_format="extended")
+
     def test_severity_threshold(self):
         self.check_rule(
             configure=["consecutive-empty-lines.severity_threshold=error=3"],
diff --git a/tests/linter/rules/spacing/empty_line_after_section/expected_extended.txt b/tests/linter/rules/spacing/empty_line_after_section/expected_extended.txt
new file mode 100644
index 0000000..a47a34e
--- /dev/null
+++ b/tests/linter/rules/spacing/empty_line_after_section/expected_extended.txt
@@ -0,0 +1,26 @@
+missing_header.robot:1:1 SPC09 Too many empty lines after '*** Comments ***' section header (1/0)
+   |
+ 1 |
+   | ^^^^^^^^^^^^^^^^ SPC09
+ 2 | # comment
+ 3 | *** Settings ***
+   |
+
+test.robot:1:1 SPC09 Too many empty lines after '*** Settings ***' section header (1/0)
+   |
+ 1 | *** Settings ***
+   | ^^^^^^^^^^^^^^^^ SPC09
+   |
+
+test.robot:10:1 SPC09 Too many empty lines after '*** Test Cases ***' section header (1/0)
+    |
+ 10 | *** Test Cases ***
+    | ^^^^^^^^^^^^^^^^^^ SPC09
+    |
+
+test.robot:20:1 SPC09 Too many empty lines after '*** Keywords ***' section header (2/0)
+    |
+ 20 | *** Keywords ***
+    | ^^^^^^^^^^^^^^^^ SPC09
+    |
+
diff --git a/tests/linter/rules/spacing/empty_line_after_section/test_rule.py b/tests/linter/rules/spacing/empty_line_after_section/test_rule.py
index a99715c..caee43a 100644
--- a/tests/linter/rules/spacing/empty_line_after_section/test_rule.py
+++ b/tests/linter/rules/spacing/empty_line_after_section/test_rule.py
@@ -5,6 +5,9 @@ class TestRuleAcceptance(RuleAcceptance):
     def test_rule(self):
         self.check_rule(expected_file="expected_output.txt")
 
+    def test_extended(self):
+        self.check_rule(expected_file="expected_extended.txt", output_format="extended")
+
     def test_severity(self):
         self.check_rule(
             configure=["empty-line-after-section.severity_threshold=error=2"],
diff --git a/tests/linter/rules/spacing/empty_lines_between_keywords/expected_extended.txt b/tests/linter/rules/spacing/empty_lines_between_keywords/expected_extended.txt
new file mode 100644
index 0000000..e4390bc
--- /dev/null
+++ b/tests/linter/rules/spacing/empty_lines_between_keywords/expected_extended.txt
@@ -0,0 +1,67 @@
+test.robot:24:1 SPC05 Invalid number of empty lines between keywords (2/1)
+    |
+ 22 |   Keyword2
+ 23 |       No Operation
+ 24 | /
+ 25 | |
+    | |_^ SPC05
+ 26 |   Keyword3
+ 27 |       No Operation
+    |
+
+test.robot:29:1 SPC05 Invalid number of empty lines between keywords (0/1)
+    |
+ 29 | # Some comment
+    | ^ SPC05
+ 30 | Keyword4
+ 31 |     No Operation
+    |
+
+test.robot:34:1 SPC05 Invalid number of empty lines between keywords (0/1)
+    |
+ 34 | # Some comment
+    | ^ SPC05
+ 35 | Keyword5
+ 36 |     No Operation
+    |
+
+test.robot:37:1 SPC05 Invalid number of empty lines between keywords (0/1)
+    |
+ 35 | Keyword5
+ 36 |     No Operation
+ 37 | # Some comment
+    | ^ SPC05
+ 38 | Keyword6
+ 39 |     No Operation
+    |
+
+test.robot:41:1 SPC05 Invalid number of empty lines between keywords (0/1)
+    |
+ 39 |     No Operation
+ 40 | # Some comment
+ 41 | # Some comment
+    | ^ SPC05
+ 42 | Keyword7
+ 43 |     No Operation
+    |
+
+test.robot:46:1 SPC05 Invalid number of empty lines between keywords (0/1)
+    |
+ 44 |
+ 45 | # Some comment
+ 46 | # Some comment
+    | ^ SPC05
+ 47 | Keyword8
+ 48 |     No Operation
+    |
+
+test.robot:52:1 SPC05 Invalid number of empty lines between keywords (0/1)
+    |
+ 50 |
+ 51 | # Some comment
+ 52 | # Some comment
+    | ^ SPC05
+ 53 | Keyword9
+ 54 |     No Operation
+    |
+
diff --git a/tests/linter/rules/spacing/empty_lines_between_keywords/expected_output.txt b/tests/linter/rules/spacing/empty_lines_between_keywords/expected_output.txt
index f66a1fa..f60722a 100644
--- a/tests/linter/rules/spacing/empty_lines_between_keywords/expected_output.txt
+++ b/tests/linter/rules/spacing/empty_lines_between_keywords/expected_output.txt
@@ -1,4 +1,4 @@
-test.robot:25:1 [W] SPC05 Invalid number of empty lines between keywords (2/1)
+test.robot:24:1 [W] SPC05 Invalid number of empty lines between keywords (2/1)
 test.robot:29:1 [W] SPC05 Invalid number of empty lines between keywords (0/1)
 test.robot:34:1 [W] SPC05 Invalid number of empty lines between keywords (0/1)
 test.robot:37:1 [W] SPC05 Invalid number of empty lines between keywords (0/1)
diff --git a/tests/linter/rules/spacing/empty_lines_between_keywords/test_rule.py b/tests/linter/rules/spacing/empty_lines_between_keywords/test_rule.py
index cba6753..4a48afe 100644
--- a/tests/linter/rules/spacing/empty_lines_between_keywords/test_rule.py
+++ b/tests/linter/rules/spacing/empty_lines_between_keywords/test_rule.py
@@ -4,3 +4,6 @@ from tests.linter.utils import RuleAcceptance
 class TestRuleAcceptance(RuleAcceptance):
     def test_rule(self):
         self.check_rule(src_files=["test.robot"], expected_file="expected_output.txt")
+
+    def test_extended(self):
+        self.check_rule(src_files=["test.robot"], expected_file="expected_extended.txt", output_format="extended")
diff --git a/tests/linter/rules/spacing/empty_lines_between_sections/expected_extended.txt b/tests/linter/rules/spacing/empty_lines_between_sections/expected_extended.txt
new file mode 100644
index 0000000..f752c8d
--- /dev/null
+++ b/tests/linter/rules/spacing/empty_lines_between_sections/expected_extended.txt
@@ -0,0 +1,72 @@
+empty_section.robot:1:1 SPC03 Invalid number of empty lines between sections (0/2)
+   |
+ 1 | *** Settings ***
+   | ^^^^^^^^^^^^^^^^ SPC03
+ 2 | *** Keywords ***
+ 3 | Keyword
+   |
+
+test.robot:5:1 SPC03 Invalid number of empty lines between sections (3/2)
+   |
+ 5 |
+   | ^^^^^^^^^^^^^^^^^^ SPC03
+ 6 | *** Variables ***
+ 7 | ${MY_VAR}    1
+   |
+
+test.robot:9:1 SPC03 Invalid number of empty lines between sections (0/2)
+   |
+ 9 | # some comment
+   | ^^^^^^^^^^^^^^ SPC03
+10 | *** Test Cases ***
+11 | Test
+   |
+
+test.robot:17:1 SPC03 Invalid number of empty lines between sections (1/2)
+    |
+ 15 |     Keyword
+ 16 |     One More
+ 17 |
+    | ^ SPC03
+ 18 | *** Keywords ***
+ 19 | Keyword
+    |
+
+test.robot:24:1 SPC03 Invalid number of empty lines between sections (0/2)
+    |
+ 22 |     Pass
+ 23 |     No Operation
+ 24 |     Fail
+    | ^^^^^^^^ SPC03
+ 25 | *** Comments ***
+ 26 | Blah Blah Blah
+    |
+
+bug861.robot:4:1 SPC03 Invalid number of empty lines between sections (0/2)
+   |
+ 4 | # Comment
+   | ^^^^^^^^^ SPC03
+ 5 | *** Variables ***
+ 6 | ${VAR}      value
+   |
+
+bug861.robot:15:1 SPC03 Invalid number of empty lines between sections (1/2)
+    |
+ 13 |     No Operation
+ 14 | # Comment
+ 15 |
+    | ^ SPC03
+ 16 | *** Keywords ***
+ 17 | Some Keyword
+    |
+
+bug861.robot:21:1 SPC03 Invalid number of empty lines between sections (1/2)
+    |
+ 19 |
+ 20 | # Comment
+ 21 |
+    | ^ SPC03
+ 22 | *** Comments ***
+ 23 | Blah Blah
+    |
+
diff --git a/tests/linter/rules/spacing/empty_lines_between_sections/test_rule.py b/tests/linter/rules/spacing/empty_lines_between_sections/test_rule.py
index 0f71c91..e4d1469 100644
--- a/tests/linter/rules/spacing/empty_lines_between_sections/test_rule.py
+++ b/tests/linter/rules/spacing/empty_lines_between_sections/test_rule.py
@@ -7,3 +7,10 @@ class TestRuleAcceptance(RuleAcceptance):
             src_files=["golden.robot", "empty_section.robot", "test.robot", "one_section.robot", "bug861.robot"],
             expected_file="expected_output.txt",
         )
+
+    def test_extended(self):
+        self.check_rule(
+            src_files=["golden.robot", "empty_section.robot", "test.robot", "one_section.robot", "bug861.robot"],
+            expected_file="expected_extended.txt",
+            output_format="extended",
+        )
diff --git a/tests/linter/rules/spacing/empty_lines_between_test_cases/expected_extended.txt b/tests/linter/rules/spacing/empty_lines_between_test_cases/expected_extended.txt
new file mode 100644
index 0000000..c7c752e
--- /dev/null
+++ b/tests/linter/rules/spacing/empty_lines_between_test_cases/expected_extended.txt
@@ -0,0 +1,77 @@
+test.robot:11:1 SPC04 Invalid number of empty lines between test cases (0/1)
+    |
+  9 |     Pass
+ 10 |     Keyword
+ 11 |     One More
+    | ^ SPC04
+ 12 | Test2
+ 13 |     Keyword
+    |
+
+test.robot:14:1 SPC04 Invalid number of empty lines between test cases (2/1)
+    |
+ 12 |   Test2
+ 13 |       Keyword
+ 14 | /
+ 15 | |
+    | |_^ SPC04
+ 16 |   Test3
+ 17 |       Keyword
+    |
+
+test.robot:19:1 SPC04 Invalid number of empty lines between test cases (0/1)
+    |
+ 19 | # Some comment
+    | ^ SPC04
+ 20 | Test 4
+ 21 |     Keyword
+    |
+
+test.robot:24:1 SPC04 Invalid number of empty lines between test cases (0/1)
+    |
+ 24 | # Some comment
+    | ^ SPC04
+ 25 | Test 5
+ 26 |     Keyword
+    |
+
+test.robot:27:1 SPC04 Invalid number of empty lines between test cases (0/1)
+    |
+ 25 | Test 5
+ 26 |     Keyword
+ 27 | # Some comment
+    | ^ SPC04
+ 28 | Test 6
+ 29 |     Keyword
+    |
+
+test.robot:32:1 SPC04 Invalid number of empty lines between test cases (0/1)
+    |
+ 30 |
+ 31 | # Some comment
+ 32 | # Some comment
+    | ^ SPC04
+ 33 | Test 7
+ 34 |     Keyword
+    |
+
+test.robot:36:1 SPC04 Invalid number of empty lines between test cases (0/1)
+    |
+ 34 |     Keyword
+ 35 | # Some comment
+ 36 | # Some comment
+    | ^ SPC04
+ 37 | Test 8
+ 38 |     Keyword
+    |
+
+test.robot:42:1 SPC04 Invalid number of empty lines between test cases (0/1)
+    |
+ 40 |
+ 41 | # Some comment
+ 42 | # Some comment
+    | ^ SPC04
+ 43 | Test 9
+ 44 |     Keyword
+    |
+
diff --git a/tests/linter/rules/spacing/empty_lines_between_test_cases/expected_output.txt b/tests/linter/rules/spacing/empty_lines_between_test_cases/expected_output.txt
index c04226b..ba85cb6 100644
--- a/tests/linter/rules/spacing/empty_lines_between_test_cases/expected_output.txt
+++ b/tests/linter/rules/spacing/empty_lines_between_test_cases/expected_output.txt
@@ -1,5 +1,5 @@
 test.robot:11:1 [W] SPC04 Invalid number of empty lines between test cases (0/1)
-test.robot:15:1 [W] SPC04 Invalid number of empty lines between test cases (2/1)
+test.robot:14:1 [W] SPC04 Invalid number of empty lines between test cases (2/1)
 test.robot:19:1 [W] SPC04 Invalid number of empty lines between test cases (0/1)
 test.robot:24:1 [W] SPC04 Invalid number of empty lines between test cases (0/1)
 test.robot:27:1 [W] SPC04 Invalid number of empty lines between test cases (0/1)
diff --git a/tests/linter/rules/spacing/empty_lines_between_test_cases/test_rule.py b/tests/linter/rules/spacing/empty_lines_between_test_cases/test_rule.py
index cba6753..4a48afe 100644
--- a/tests/linter/rules/spacing/empty_lines_between_test_cases/test_rule.py
+++ b/tests/linter/rules/spacing/empty_lines_between_test_cases/test_rule.py
@@ -4,3 +4,6 @@ from tests.linter.utils import RuleAcceptance
 class TestRuleAcceptance(RuleAcceptance):
     def test_rule(self):
         self.check_rule(src_files=["test.robot"], expected_file="expected_output.txt")
+
+    def test_extended(self):
+        self.check_rule(src_files=["test.robot"], expected_file="expected_extended.txt", output_format="extended")
diff --git a/tests/linter/rules/spacing/empty_lines_in_statement/expected_extended.txt b/tests/linter/rules/spacing/empty_lines_in_statement/expected_extended.txt
new file mode 100644
index 0000000..e9a7caf
--- /dev/null
+++ b/tests/linter/rules/spacing/empty_lines_in_statement/expected_extended.txt
@@ -0,0 +1,37 @@
+test.robot:4:1 SPC13 Multi-line statement with empty lines
+   |
+ 2 | Documentation    This is
+ 3 | ...   multiline line
+ 4 |
+   | ^ SPC13
+ 5 | ...  docs
+   |
+
+test.robot:11:1 SPC13 Multi-line statement with empty lines
+    |
+  9 | %{variable}    a=1
+ 10 | ...   b=2
+ 11 |
+    | ^ SPC13
+ 12 | ...  c=2
+    |
+
+test.robot:20:1 SPC13 Multi-line statement with empty lines
+    |
+ 18 | Test case
+ 19 |     Multiline Keyword  1
+ 20 |
+    | ^ SPC13
+ 21 |     ...  2
+    |
+
+test.robot:29:1 SPC13 Multi-line statement with empty lines
+    |
+ 27 | Keyword 2
+ 28 |     [Arguments]  ${arg}
+ 29 |
+    | ^ SPC13
+ 30 |     ...    1
+ 31 |     ...    2
+    |
+
diff --git a/tests/linter/rules/spacing/empty_lines_in_statement/test_rule.py b/tests/linter/rules/spacing/empty_lines_in_statement/test_rule.py
index cba6753..4a48afe 100644
--- a/tests/linter/rules/spacing/empty_lines_in_statement/test_rule.py
+++ b/tests/linter/rules/spacing/empty_lines_in_statement/test_rule.py
@@ -4,3 +4,6 @@ from tests.linter.utils import RuleAcceptance
 class TestRuleAcceptance(RuleAcceptance):
     def test_rule(self):
         self.check_rule(src_files=["test.robot"], expected_file="expected_output.txt")
+
+    def test_extended(self):
+        self.check_rule(src_files=["test.robot"], expected_file="expected_extended.txt", output_format="extended")
diff --git a/tests/linter/rules/spacing/first_argument_in_new_line/expected_extended.txt b/tests/linter/rules/spacing/first_argument_in_new_line/expected_extended.txt
new file mode 100644
index 0000000..9276cf1
--- /dev/null
+++ b/tests/linter/rules/spacing/first_argument_in_new_line/expected_extended.txt
@@ -0,0 +1,74 @@
+test.robot:25:16 SPC18 First argument: '${optional_argument}=value' is not placed on the same line as [Arguments] setting
+    |
+ 23 |   Keyword With First Arg In New Line
+ 24 |       [Documentation]  doc
+ 25 | /     [Arguments]
+ 26 | |     ...     ${optional_argument}=value
+    | |_^ SPC18
+ 27 |       Log    ${optional_argument}
+    |
+
+test.robot:31:16 SPC18 First argument: '${some_argument}' is not placed on the same line as [Arguments] setting
+    |
+ 29 |   Another Keyword With First Arg In New Line
+ 30 |       [Documentation]  doc
+ 31 | /     [Arguments]
+ 32 | |     ...     ${some_argument}
+    | |_^ SPC18
+ 33 |       Log    ${some_argument}
+    |
+
+test.robot:37:16 SPC18 First argument: '&{named}' is not placed on the same line as [Arguments] setting
+    |
+ 35 |   Free Named Only
+ 36 |       [Documentation]  doc
+ 37 | /     [Arguments]
+ 38 | |     ...    &{named}
+    | |_^ SPC18
+ 39 |       Log Many    &{named}
+    |
+
+test.robot:43:16 SPC18 First argument: '${required}' is not placed on the same line as [Arguments] setting
+    |
+ 41 |   Positional And Free Named
+ 42 |       [Documentation]  doc
+ 43 | /     [Arguments]
+ 44 | |     ...    ${required}
+    | |_^ SPC18
+ 45 |       ...    &{extra}
+ 46 |       Log Many    ${required}    &{extra}
+    |
+
+test.robot:50:16 SPC18 First argument: '@{args}' is not placed on the same line as [Arguments] setting
+    |
+ 48 |   Run Program
+ 49 |       [Documentation]  doc
+ 50 | /     [Arguments]
+ 51 | |     ...    @{args}
+    | |_^ SPC18
+ 52 |       ...    &{config}
+ 53 |       No Operation
+    |
+
+test.robot:57:16 SPC18 First argument: '@{varargs}' is not placed on the same line as [Arguments] setting
+    |
+ 55 |   With Varargs
+ 56 |       [Documentation]  doc
+ 57 | /     [Arguments]
+ 58 | |     ...    @{varargs}
+    | |_^ SPC18
+ 59 |       ...    ${named}
+ 60 |       Log Many    @{varargs}    ${named}
+    |
+
+test.robot:64:16 SPC18 First argument: '@{}' is not placed on the same line as [Arguments] setting
+    |
+ 62 |   Without Varargs
+ 63 |       [Documentation]  doc
+ 64 | /     [Arguments]
+ 65 | |     ...    @{}
+    | |_^ SPC18
+ 66 |       ...    ${first}
+ 67 |       ...    ${second}
+    |
+
diff --git a/tests/linter/rules/spacing/first_argument_in_new_line/test_rule.py b/tests/linter/rules/spacing/first_argument_in_new_line/test_rule.py
index cba6753..4a48afe 100644
--- a/tests/linter/rules/spacing/first_argument_in_new_line/test_rule.py
+++ b/tests/linter/rules/spacing/first_argument_in_new_line/test_rule.py
@@ -4,3 +4,6 @@ from tests.linter.utils import RuleAcceptance
 class TestRuleAcceptance(RuleAcceptance):
     def test_rule(self):
         self.check_rule(src_files=["test.robot"], expected_file="expected_output.txt")
+
+    def test_extended(self):
+        self.check_rule(src_files=["test.robot"], expected_file="expected_extended.txt", output_format="extended")
diff --git a/tests/linter/rules/spacing/misaligned_continuation/expected_extended.txt b/tests/linter/rules/spacing/misaligned_continuation/expected_extended.txt
new file mode 100644
index 0000000..6cbc594
--- /dev/null
+++ b/tests/linter/rules/spacing/misaligned_continuation/expected_extended.txt
@@ -0,0 +1,57 @@
+tests.robot:7:3 SPC11 Continuation marker is not aligned with starting row
+   |
+ 5 | ...                It can also contain multiple paragraphs.
+ 6 | Default Tags       default tag 1    default tag 2    default tag 3
+ 7 |   ...                default tag 4    default tag 5
+   |   ^^^ SPC11
+   |
+
+tests.robot:15:3 SPC11 Continuation marker is not aligned with starting row
+    |
+ 13 | ${MULTILINE}       SEPARATOR=\n
+ 14 | ...                This is a long multiline string.
+ 15 |   ...                This is the second line.
+    |   ^^^ SPC11
+ 16 | ...                This is the third and the last line.
+ 17 | @{LIST}            this     list     is      quite    long     and
+    |
+
+tests.robot:27:3 SPC11 Continuation marker is not aligned with starting row
+    |
+ 25 |     ...       tags    in    real    life
+ 26 |     Do X    first argument    second argument    third argument
+ 27 |   ...    fourth argument    fifth argument    sixth argument
+    |   ^^^ SPC11
+ 28 |     ${var} =    Get X
+ 29 |     ...    first argument passed to this keyword is pretty long
+    |
+
+tests.robot:35:7 SPC11 Continuation marker is not aligned with starting row
+    |
+ 33 | Misaligned headers
+ 34 |     FOR  ${value}  IN  ${1}
+ 35 |       ...  ${2}
+    |       ^^^ SPC11
+ 36 |         Keyword
+ 37 |     END
+    |
+
+tests.robot:41:4 SPC11 Continuation marker is not aligned with starting row
+    |
+ 39 | Misaligned Arguments
+ 40 |     [Arguments]    ${arg}
+ 41 |    ...  ${arg}
+    |    ^^^ SPC11
+ 42 |     Keyword
+    |
+
+tests.robot:53:7 SPC11 Continuation marker is not aligned with starting row
+    |
+ 51 |         Keyword
+ 52 |     EXCEPT  Error
+ 53 |       ...  Error2
+    |       ^^^ SPC11
+ 54 |         Keyword
+ 55 |     END
+    |
+
diff --git a/tests/linter/rules/spacing/misaligned_continuation/test_rule.py b/tests/linter/rules/spacing/misaligned_continuation/test_rule.py
index c1d7c64..c57dd4f 100644
--- a/tests/linter/rules/spacing/misaligned_continuation/test_rule.py
+++ b/tests/linter/rules/spacing/misaligned_continuation/test_rule.py
@@ -4,3 +4,6 @@ from tests.linter.utils import RuleAcceptance
 class TestRuleAcceptance(RuleAcceptance):
     def test_rule(self):
         self.check_rule(src_files=["tests.robot"], expected_file="expected_output.txt")
+
+    def test_extended(self):
+        self.check_rule(src_files=["tests.robot"], expected_file="expected_extended.txt", output_format="extended")
diff --git a/tests/linter/rules/spacing/misaligned_continuation_row/expected_extended.txt b/tests/linter/rules/spacing/misaligned_continuation_row/expected_extended.txt
new file mode 100644
index 0000000..a041350
--- /dev/null
+++ b/tests/linter/rules/spacing/misaligned_continuation_row/expected_extended.txt
@@ -0,0 +1,71 @@
+test.robot:10:4 SPC15 Continuation line is not aligned with the previous one
+    |
+  8 | Force Tags
+  9 | ...   tag
+ 10 | ...    tag2
+    |    ^^^^ SPC15
+    |
+
+test.robot:19:4 SPC15 Continuation line is not aligned with the previous one
+    |
+ 17 | ${MULTILINE}       SEPARATOR=\n
+ 18 | ...                This is a long multiline string.
+ 19 | ...               This is the second line.
+    |    ^^^^^^^^^^^^^^^ SPC15
+ 20 | ...                This is the third and the last line.
+ 21 | @{LIST}            this     list     is      quite    long     and
+    |
+
+test.robot:38:8 SPC15 Continuation line is not aligned with the previous one
+    |
+ 36 | Test
+ 37 |     [Tags]    you    probably    do    not    have    this    many
+ 38 |     ...      tags    in    real    life
+    |        ^^^^^^ SPC15
+ 39 |     Do X    first argument    second argument    third argument
+ 40 |     ...    fourth argument    fifth argument    sixth argument
+    |
+
+test.robot:41:8 SPC15 Continuation line is not aligned with the previous one
+    |
+ 39 |     Do X    first argument    second argument    third argument
+ 40 |     ...    fourth argument    fifth argument    sixth argument
+ 41 |     ...  misaligned argument
+    |        ^^ SPC15
+ 42 |     ${var} =    Get X
+ 43 |     ...    first argument passed to this keyword is pretty long
+    |
+
+test.robot:44:8 SPC15 Continuation line is not aligned with the previous one
+    |
+ 42 |     ${var} =    Get X
+ 43 |     ...    first argument passed to this keyword is pretty long
+ 44 |     ...     second argument passed to this keyword is long too
+    |        ^^^^^ SPC15
+    |
+
+test.robot:58:8 SPC15 Continuation line is not aligned with the previous one
+    |
+ 56 |     ...  ${value}
+ 57 |     ...  2
+ 58 |     ...      ${value2}
+    |        ^^^^^^ SPC15
+    |
+
+test.robot:68:8 SPC15 Continuation line is not aligned with the previous one
+    |
+ 66 |     No Operation
+ 67 |     ...  1
+ 68 |     ...   2
+    |        ^^^ SPC15
+ 69 |     ...    3
+    |
+
+test.robot:69:8 SPC15 Continuation line is not aligned with the previous one
+    |
+ 67 |     ...  1
+ 68 |     ...   2
+ 69 |     ...    3
+    |        ^^^^ SPC15
+    |
+
diff --git a/tests/linter/rules/spacing/misaligned_continuation_row/test_rule.py b/tests/linter/rules/spacing/misaligned_continuation_row/test_rule.py
index a2d25bc..50959aa 100644
--- a/tests/linter/rules/spacing/misaligned_continuation_row/test_rule.py
+++ b/tests/linter/rules/spacing/misaligned_continuation_row/test_rule.py
@@ -7,6 +7,9 @@ class TestRuleAcceptance(RuleAcceptance):
     def test_rule(self):
         self.check_rule(src_files=["test.robot"], expected_file="expected_output.txt")
 
+    def test_extended(self):
+        self.check_rule(src_files=["test.robot"], expected_file="expected_extended.txt", output_format="extended")
+
     def test_ignore_docs(self):
         self.check_rule(
             configure=["misaligned-continuation-row.ignore_docs=False"],
diff --git a/tests/linter/rules/spacing/missing_trailing_blank_line/expected_extended.txt b/tests/linter/rules/spacing/missing_trailing_blank_line/expected_extended.txt
new file mode 100644
index 0000000..15a5757
--- /dev/null
+++ b/tests/linter/rules/spacing/missing_trailing_blank_line/expected_extended.txt
@@ -0,0 +1,8 @@
+test.robot:7:1 SPC02 Missing trailing blank line at the end of file
+   |
+ 5 |     Pass
+ 6 |     Keyword
+ 7 |     No Operation
+   | ^^^^^^^^^^^^^^^^ SPC02
+   |
+
diff --git a/tests/linter/rules/spacing/missing_trailing_blank_line/test_rule.py b/tests/linter/rules/spacing/missing_trailing_blank_line/test_rule.py
index e0553eb..931c17e 100644
--- a/tests/linter/rules/spacing/missing_trailing_blank_line/test_rule.py
+++ b/tests/linter/rules/spacing/missing_trailing_blank_line/test_rule.py
@@ -4,3 +4,6 @@ from tests.linter.utils import RuleAcceptance
 class TestRuleAcceptance(RuleAcceptance):
     def test_rule(self):
         self.check_rule(expected_file="expected_output.txt")
+
+    def test_extended(self):
+        self.check_rule(expected_file="expected_extended.txt", output_format="extended")
diff --git a/tests/linter/rules/spacing/mixed_tabs_and_spaces/expected_extended.txt b/tests/linter/rules/spacing/mixed_tabs_and_spaces/expected_extended.txt
new file mode 100644
index 0000000..3c85c71
--- /dev/null
+++ b/tests/linter/rules/spacing/mixed_tabs_and_spaces/expected_extended.txt
@@ -0,0 +1,1 @@
+test.robot:1:1 SPC06 Inconsistent use of tabs and spaces in file
\ No newline at end of file
diff --git a/tests/linter/rules/spacing/mixed_tabs_and_spaces/test_rule.py b/tests/linter/rules/spacing/mixed_tabs_and_spaces/test_rule.py
index cba6753..4a48afe 100644
--- a/tests/linter/rules/spacing/mixed_tabs_and_spaces/test_rule.py
+++ b/tests/linter/rules/spacing/mixed_tabs_and_spaces/test_rule.py
@@ -4,3 +4,6 @@ from tests.linter.utils import RuleAcceptance
 class TestRuleAcceptance(RuleAcceptance):
     def test_rule(self):
         self.check_rule(src_files=["test.robot"], expected_file="expected_output.txt")
+
+    def test_extended(self):
+        self.check_rule(src_files=["test.robot"], expected_file="expected_extended.txt", output_format="extended")
diff --git a/tests/linter/rules/spacing/suite_setting_not_left_aligned/expected_extended.txt b/tests/linter/rules/spacing/suite_setting_not_left_aligned/expected_extended.txt
new file mode 100644
index 0000000..acc8861
--- /dev/null
+++ b/tests/linter/rules/spacing/suite_setting_not_left_aligned/expected_extended.txt
@@ -0,0 +1,218 @@
+four_spaces.robot:2:5 SPC16 Setting in Settings section is not left aligned
+   |
+ 1 | *** Settings ***
+ 2 |     Library  Collections
+   |     ^^^^^^^ SPC16
+ 3 |     Resource  data.resource
+ 4 |     Variables  vars.robot
+   |
+
+four_spaces.robot:3:5 SPC16 Setting in Settings section is not left aligned
+   |
+ 1 | *** Settings ***
+ 2 |     Library  Collections
+ 3 |     Resource  data.resource
+   |     ^^^^^^^^ SPC16
+ 4 |     Variables  vars.robot
+   |
+
+four_spaces.robot:4:5 SPC16 Setting in Settings section is not left aligned
+   |
+ 2 |     Library  Collections
+ 3 |     Resource  data.resource
+ 4 |     Variables  vars.robot
+   |     ^^^^^^^^^ SPC16
+   |
+
+four_spaces.robot:6:5 SPC16 Setting in Settings section is not left aligned
+   |
+ 6 |     Force Tags  tag
+   |     ^^^^^^^^^^ SPC16
+ 7 |     ...  tag2
+   |
+
+four_spaces.robot:9:5 SPC16 Setting in Settings section is not left aligned
+   |
+ 9 |     Default Tags  tag
+   |     ^^^^^^^^^^^^ SPC16
+   |
+
+four_spaces.robot:11:5 SPC16 Setting in Settings section is not left aligned
+    |
+ 11 |     Suite Setup  Keyword
+    |     ^^^^^^^^^^^ SPC16
+ 12 |     Suite Teardown  Keyword
+ 13 |     Test Setup  Keyword
+    |
+
+four_spaces.robot:12:5 SPC16 Setting in Settings section is not left aligned
+    |
+ 10 |
+ 11 |     Suite Setup  Keyword
+ 12 |     Suite Teardown  Keyword
+    |     ^^^^^^^^^^^^^^ SPC16
+ 13 |     Test Setup  Keyword
+ 14 |     Test Teardown  Keyword
+    |
+
+four_spaces.robot:13:5 SPC16 Setting in Settings section is not left aligned
+    |
+ 11 |     Suite Setup  Keyword
+ 12 |     Suite Teardown  Keyword
+ 13 |     Test Setup  Keyword
+    |     ^^^^^^^^^^ SPC16
+ 14 |     Test Teardown  Keyword
+ 15 |     Test Timeout  1 day
+    |
+
+four_spaces.robot:14:5 SPC16 Setting in Settings section is not left aligned
+    |
+ 12 |     Suite Teardown  Keyword
+ 13 |     Test Setup  Keyword
+ 14 |     Test Teardown  Keyword
+    |     ^^^^^^^^^^^^^ SPC16
+ 15 |     Test Timeout  1 day
+ 16 |     Test Template  Keyword
+    |
+
+four_spaces.robot:15:5 SPC16 Setting in Settings section is not left aligned
+    |
+ 13 |     Test Setup  Keyword
+ 14 |     Test Teardown  Keyword
+ 15 |     Test Timeout  1 day
+    |     ^^^^^^^^^^^^ SPC16
+ 16 |     Test Template  Keyword
+    |
+
+four_spaces.robot:16:5 SPC16 Setting in Settings section is not left aligned
+    |
+ 14 |     Test Teardown  Keyword
+ 15 |     Test Timeout  1 day
+ 16 |     Test Template  Keyword
+    |     ^^^^^^^^^^^^^ SPC16
+    |
+
+four_spaces.robot:18:5 SPC16 Setting in Settings section is not left aligned
+    |
+ 18 |     Documentation  doc
+    |     ^^^^^^^^^^^^^ SPC16
+ 19 |     Metadata  meta  data
+    |
+
+four_spaces.robot:19:5 SPC16 Setting in Settings section is not left aligned
+    |
+ 17 |
+ 18 |     Documentation  doc
+ 19 |     Metadata  meta  data
+    |     ^^^^^^^^ SPC16
+    |
+
+one_space.robot:2:2 SPC16 Setting in Settings section is not left aligned
+   |
+ 1 | *** Settings ***
+ 2 |  Library  Collections
+   |  ^ SPC16
+ 3 |  Resource  data.resource
+ 4 |  Variables  vars.robot
+   |
+
+one_space.robot:3:2 SPC16 Setting in Settings section is not left aligned
+   |
+ 1 | *** Settings ***
+ 2 |  Library  Collections
+ 3 |  Resource  data.resource
+   |  ^ SPC16
+ 4 |  Variables  vars.robot
+   |
+
+one_space.robot:4:2 SPC16 Setting in Settings section is not left aligned
+   |
+ 2 |  Library  Collections
+ 3 |  Resource  data.resource
+ 4 |  Variables  vars.robot
+   |  ^ SPC16
+   |
+
+one_space.robot:6:2 SPC16 Setting in Settings section is not left aligned
+   |
+ 6 |  Force Tags  tag
+   |  ^ SPC16
+ 7 | ...  tag2
+   |
+
+one_space.robot:9:2 SPC16 Setting in Settings section is not left aligned
+   |
+ 9 |  Default Tags tag
+   |  ^ SPC16
+   |
+
+one_space.robot:11:2 SPC16 Setting in Settings section is not left aligned
+    |
+ 11 |  Suite Setup  Keyword
+    |  ^ SPC16
+ 12 |  Suite Teardown  Keyword
+ 13 |  Test Setup  Keyword
+    |
+
+one_space.robot:12:2 SPC16 Setting in Settings section is not left aligned
+    |
+ 10 |
+ 11 |  Suite Setup  Keyword
+ 12 |  Suite Teardown  Keyword
+    |  ^ SPC16
+ 13 |  Test Setup  Keyword
+ 14 |  Test Teardown  Keyword
+    |
+
+one_space.robot:13:2 SPC16 Setting in Settings section is not left aligned
+    |
+ 11 |  Suite Setup  Keyword
+ 12 |  Suite Teardown  Keyword
+ 13 |  Test Setup  Keyword
+    |  ^ SPC16
+ 14 |  Test Teardown  Keyword
+ 15 |  Test Timeout  1 day
+    |
+
+one_space.robot:14:2 SPC16 Setting in Settings section is not left aligned
+    |
+ 12 |  Suite Teardown  Keyword
+ 13 |  Test Setup  Keyword
+ 14 |  Test Teardown  Keyword
+    |  ^ SPC16
+ 15 |  Test Timeout  1 day
+ 16 |  Test Template  Keyword
+    |
+
+one_space.robot:15:2 SPC16 Setting in Settings section is not left aligned
+    |
+ 13 |  Test Setup  Keyword
+ 14 |  Test Teardown  Keyword
+ 15 |  Test Timeout  1 day
+    |  ^ SPC16
+ 16 |  Test Template  Keyword
+    |
+
+one_space.robot:16:2 SPC16 Setting in Settings section is not left aligned
+    |
+ 14 |  Test Teardown  Keyword
+ 15 |  Test Timeout  1 day
+ 16 |  Test Template  Keyword
+    |  ^ SPC16
+    |
+
+one_space.robot:18:2 SPC16 Setting in Settings section is not left aligned
+    |
+ 18 |  Documentation  doc
+    |  ^ SPC16
+ 19 |  Metadata  meta  data
+    |
+
+one_space.robot:19:2 SPC16 Setting in Settings section is not left aligned
+    |
+ 17 |
+ 18 |  Documentation  doc
+ 19 |  Metadata  meta  data
+    |  ^ SPC16
+    |
+
diff --git a/tests/linter/rules/spacing/suite_setting_not_left_aligned/test_rule.py b/tests/linter/rules/spacing/suite_setting_not_left_aligned/test_rule.py
index 3856c73..67b2d25 100644
--- a/tests/linter/rules/spacing/suite_setting_not_left_aligned/test_rule.py
+++ b/tests/linter/rules/spacing/suite_setting_not_left_aligned/test_rule.py
@@ -4,3 +4,6 @@ from tests.linter.utils import RuleAcceptance
 class TestRuleAcceptance(RuleAcceptance):
     def test_rule(self):
         self.check_rule(expected_file="expected_output.txt", test_on_version=">=4")
+
+    def test_extended(self):
+        self.check_rule(expected_file="expected_extended.txt", output_format="extended", test_on_version=">=4")
diff --git a/tests/linter/rules/spacing/too_many_trailing_blank_lines/expected_extended.txt b/tests/linter/rules/spacing/too_many_trailing_blank_lines/expected_extended.txt
new file mode 100644
index 0000000..ce0ecf4
--- /dev/null
+++ b/tests/linter/rules/spacing/too_many_trailing_blank_lines/expected_extended.txt
@@ -0,0 +1,2 @@
+test.robot:23:1 SPC10 Too many blank lines at the end of file
+test2.robot:22:1 SPC10 Too many blank lines at the end of file
\ No newline at end of file
diff --git a/tests/linter/rules/spacing/too_many_trailing_blank_lines/test_rule.py b/tests/linter/rules/spacing/too_many_trailing_blank_lines/test_rule.py
index e0553eb..931c17e 100644
--- a/tests/linter/rules/spacing/too_many_trailing_blank_lines/test_rule.py
+++ b/tests/linter/rules/spacing/too_many_trailing_blank_lines/test_rule.py
@@ -4,3 +4,6 @@ from tests.linter.utils import RuleAcceptance
 class TestRuleAcceptance(RuleAcceptance):
     def test_rule(self):
         self.check_rule(expected_file="expected_output.txt")
+
+    def test_extended(self):
+        self.check_rule(expected_file="expected_extended.txt", output_format="extended")
diff --git a/tests/linter/rules/spacing/trailing_whitespace/expected_extended.txt b/tests/linter/rules/spacing/trailing_whitespace/expected_extended.txt
new file mode 100644
index 0000000..03afbf0
--- /dev/null
+++ b/tests/linter/rules/spacing/trailing_whitespace/expected_extended.txt
@@ -0,0 +1,28 @@
+test.robot:5:19 SPC01 Trailing whitespace at the end of line
+   |
+ 5 | *** Test Cases ***
+   |                   ^ SPC01
+ 6 | Test
+ 7 |     [Documentation]  doc
+   |
+
+test.robot:16:33 SPC01 Trailing whitespace at the end of line
+    |
+ 14 | *** Keywords ***
+ 15 | Keyword
+ 16 |     [Documentation]  this is doc
+    |                                 ^^ SPC01
+ 17 |     No Operation
+ 18 |     Pass
+    |
+
+test.robot:24:33 SPC01 Trailing whitespace at the end of line
+    |
+ 22 |
+ 23 | Keyword1  # with tab
+ 24 |     [Documentation]  this is doc
+    |                                 ^^ SPC01
+ 25 |     No Operation
+ 26 |     Pass
+    |
+
diff --git a/tests/linter/rules/spacing/trailing_whitespace/expected_output.txt b/tests/linter/rules/spacing/trailing_whitespace/expected_output.txt
index a88513c..ee48fbd 100644
--- a/tests/linter/rules/spacing/trailing_whitespace/expected_output.txt
+++ b/tests/linter/rules/spacing/trailing_whitespace/expected_output.txt
@@ -1,3 +1,3 @@
 test.robot:5:19 [W] SPC01 Trailing whitespace at the end of line
-test.robot:16:34 [W] SPC01 Trailing whitespace at the end of line
-test.robot:24:34 [W] SPC01 Trailing whitespace at the end of line
\ No newline at end of file
+test.robot:16:33 [W] SPC01 Trailing whitespace at the end of line
+test.robot:24:33 [W] SPC01 Trailing whitespace at the end of line
\ No newline at end of file
diff --git a/tests/linter/rules/spacing/trailing_whitespace/test_rule.py b/tests/linter/rules/spacing/trailing_whitespace/test_rule.py
index cba6753..4a48afe 100644
--- a/tests/linter/rules/spacing/trailing_whitespace/test_rule.py
+++ b/tests/linter/rules/spacing/trailing_whitespace/test_rule.py
@@ -4,3 +4,6 @@ from tests.linter.utils import RuleAcceptance
 class TestRuleAcceptance(RuleAcceptance):
     def test_rule(self):
         self.check_rule(src_files=["test.robot"], expected_file="expected_output.txt")
+
+    def test_extended(self):
+        self.check_rule(src_files=["test.robot"], expected_file="expected_extended.txt", output_format="extended")
diff --git a/tests/linter/rules/spacing/variable_not_left_aligned/expected_extended.txt b/tests/linter/rules/spacing/variable_not_left_aligned/expected_extended.txt
new file mode 100644
index 0000000..5a7ec05
--- /dev/null
+++ b/tests/linter/rules/spacing/variable_not_left_aligned/expected_extended.txt
@@ -0,0 +1,50 @@
+test.robot:7:1 SPC14 Variable in Variables section is not left aligned
+   |
+ 5 |
+ 6 | *** Variables ***
+ 7 |  ${MY VAR}  10
+   | ^ SPC14
+ 8 |   ${MY VAR1}  10
+ 9 |    ${MY VAR2}  10
+   |
+
+test.robot:8:1 SPC14 Variable in Variables section is not left aligned
+   |
+ 6 | *** Variables ***
+ 7 |  ${MY VAR}  10
+ 8 |   ${MY VAR1}  10
+   | ^^ SPC14
+ 9 |    ${MY VAR2}  10
+10 |     ${MY VAR3}  10
+   |
+
+test.robot:9:1 SPC14 Variable in Variables section is not left aligned
+   |
+ 7 |  ${MY VAR}  10
+ 8 |   ${MY VAR1}  10
+ 9 |    ${MY VAR2}  10
+   | ^^^ SPC14
+10 |     ${MY VAR3}  10
+11 | ${GOLD VAR}  10
+   |
+
+test.robot:10:1 SPC14 Variable in Variables section is not left aligned
+    |
+  8 |   ${MY VAR1}  10
+  9 |    ${MY VAR2}  10
+ 10 |     ${MY VAR3}  10
+    | ^^^^ SPC14
+ 11 | ${GOLD VAR}  10
+ 12 |   ${NOT_ALIGNED}  1
+    |
+
+test.robot:12:1 SPC14 Variable in Variables section is not left aligned
+    |
+ 10 |     ${MY VAR3}  10
+ 11 | ${GOLD VAR}  10
+ 12 |   ${NOT_ALIGNED}  1
+    | ^^ SPC14
+ 13 | ...  2
+ 14 | ${ALIGNED}  1
+    |
+
diff --git a/tests/linter/rules/spacing/variable_not_left_aligned/test_rule.py b/tests/linter/rules/spacing/variable_not_left_aligned/test_rule.py
index baefc3b..90605cb 100644
--- a/tests/linter/rules/spacing/variable_not_left_aligned/test_rule.py
+++ b/tests/linter/rules/spacing/variable_not_left_aligned/test_rule.py
@@ -4,3 +4,11 @@ from tests.linter.utils import RuleAcceptance
 class TestRuleAcceptance(RuleAcceptance):
     def test_rule(self):
         self.check_rule(src_files=["test.robot"], expected_file="expected_output.txt", test_on_version=">=4")
+
+    def test_extended(self):
+        self.check_rule(
+            src_files=["test.robot"],
+            expected_file="expected_extended.txt",
+            output_format="extended",
+            test_on_version=">=4",
+        )