Skip to content

Commit

Permalink
Change the tab/space complaint message to be shorter and use the norm…
Browse files Browse the repository at this point in the history
…al line-number machinery
  • Loading branch information
tabatkins committed Mar 10, 2025
1 parent 73817f8 commit 50d0ec7
Show file tree
Hide file tree
Showing 88 changed files with 3,696 additions and 3,695 deletions.
5 changes: 3 additions & 2 deletions bikeshed/Spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,9 +578,9 @@ def checkForMixedIndents(lines: t.Sequence[l.Line], info: metadata.IndentInfo) -
continue
if line.text.startswith(badIndentChar):
if info.char == " ":
m.lint(f"Your document appears to use spaces to indent, but line {line.i} starts with tabs.")
m.lint("Line starts with tabs, but document is space-indented", lineNum=line.i)
else:
m.lint(f"Your document appears to use tabs to indent, but line {line.i} starts with spaces.")
m.lint("Line starts with spaces, but document is tab-indented", lineNum=line.i)
if re.match(r"(\t+ +\t)|( +\t)", line.text):
m.lint(f"Line {line.i}'s indent contains tabs after spaces.")

Expand Down Expand Up @@ -615,3 +615,4 @@ def FIXMEreplaceMarkdownBlockquotes(text: str) -> str:
else:
i += 1
return "\n".join(lines)
return "\n".join(lines)

Check warning on line 618 in bikeshed/Spec.py

View workflow job for this annotation

GitHub Actions / lint

Unreachable code (unreachable)
12 changes: 6 additions & 6 deletions tests/github/WICG/aom/spec/input-events.console.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
LINE 4:60 of Abstract metadata: Found unmatched text macro [UI-EVENTS]. Correct the macro, or escape it by replacing the opening [ with &bs[;
LINT: Your document appears to use tabs to indent, but line 48 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 49 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 161 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 162 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 164 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 165 starts with spaces.
LINE 48: Line starts with spaces, but document is tab-indented
LINE 49: Line starts with spaces, but document is tab-indented
LINE 161: Line starts with spaces, but document is tab-indented
LINE 162: Line starts with spaces, but document is tab-indented
LINE 164: Line starts with spaces, but document is tab-indented
LINE 165: Line starts with spaces, but document is tab-indented
LINE 4:60 of macro [ABSTRACT]: Found unmatched text macro [UI-EVENTS]. Correct the macro, or escape it by replacing the opening [ with &bs[;
LINE 77:5: Unexported dfn that's not referenced locally - did you mean to export it?
<dfn bs-line-number="77:5" data-dfn-for="InputEvent" data-dfn-type="dfn" id="inputevent-inputtype" data-lt="inputType" data-noexport="by-default" class="dfn-paneled">inputType</dfn>
Expand Down
60 changes: 30 additions & 30 deletions tests/github/WICG/construct-stylesheets/index.console.txt
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
LINT: Your document appears to use tabs to indent, but line 43 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 44 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 45 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 46 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 47 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 48 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 49 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 50 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 51 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 52 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 53 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 54 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 130 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 131 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 132 starts with spaces.
LINE 43: Line starts with spaces, but document is tab-indented
LINE 44: Line starts with spaces, but document is tab-indented
LINE 45: Line starts with spaces, but document is tab-indented
LINE 46: Line starts with spaces, but document is tab-indented
LINE 47: Line starts with spaces, but document is tab-indented
LINE 48: Line starts with spaces, but document is tab-indented
LINE 49: Line starts with spaces, but document is tab-indented
LINE 50: Line starts with spaces, but document is tab-indented
LINE 51: Line starts with spaces, but document is tab-indented
LINE 52: Line starts with spaces, but document is tab-indented
LINE 53: Line starts with spaces, but document is tab-indented
LINE 54: Line starts with spaces, but document is tab-indented
LINE 130: Line starts with spaces, but document is tab-indented
LINE 131: Line starts with spaces, but document is tab-indented
LINE 132: Line starts with spaces, but document is tab-indented
LINT: Line 132's indent contains tabs after spaces.
LINT: Your document appears to use tabs to indent, but line 134 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 138 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 139 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 140 starts with spaces.
LINE 134: Line starts with spaces, but document is tab-indented
LINE 138: Line starts with spaces, but document is tab-indented
LINE 139: Line starts with spaces, but document is tab-indented
LINE 140: Line starts with spaces, but document is tab-indented
LINT: Line 140's indent contains tabs after spaces.
LINT: Your document appears to use tabs to indent, but line 145 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 146 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 147 starts with spaces.
LINE 145: Line starts with spaces, but document is tab-indented
LINE 146: Line starts with spaces, but document is tab-indented
LINE 147: Line starts with spaces, but document is tab-indented
LINT: Line 147's indent contains tabs after spaces.
LINT: Your document appears to use tabs to indent, but line 155 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 156 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 158 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 159 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 160 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 163 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 175 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 178 starts with spaces.
LINE 155: Line starts with spaces, but document is tab-indented
LINE 156: Line starts with spaces, but document is tab-indented
LINE 158: Line starts with spaces, but document is tab-indented
LINE 159: Line starts with spaces, but document is tab-indented
LINE 160: Line starts with spaces, but document is tab-indented
LINE 163: Line starts with spaces, but document is tab-indented
LINE 175: Line starts with spaces, but document is tab-indented
LINE 178: Line starts with spaces, but document is tab-indented
LINT: Line 178's indent contains tabs after spaces.
LINE 82:44: Multiple possible 'base url' dfn refs.
Arbitrarily chose https://html.spec.whatwg.org/multipage/semantics.html#link-options-base-url
Expand Down
22 changes: 11 additions & 11 deletions tests/github/WICG/cq-usecases/index.console.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
WARNING: You used Status ED, but your Group (WICG) is limited to the statuses CG-DRAFT, CG-FINAL, or UD.
LINE 1:308 of Abstract metadata: Saw an end tag </a>, but there's no open element corresponding to it.
LINT: Your document appears to use spaces to indent, but line 48 starts with tabs.
LINT: Your document appears to use spaces to indent, but line 49 starts with tabs.
LINT: Your document appears to use spaces to indent, but line 55 starts with tabs.
LINT: Your document appears to use spaces to indent, but line 56 starts with tabs.
LINT: Your document appears to use spaces to indent, but line 62 starts with tabs.
LINT: Your document appears to use spaces to indent, but line 63 starts with tabs.
LINT: Your document appears to use spaces to indent, but line 69 starts with tabs.
LINT: Your document appears to use spaces to indent, but line 70 starts with tabs.
LINT: Your document appears to use spaces to indent, but line 76 starts with tabs.
LINT: Your document appears to use spaces to indent, but line 77 starts with tabs.
LINT: Your document appears to use spaces to indent, but line 134 starts with tabs.
LINE 48: Line starts with tabs, but document is space-indented
LINE 49: Line starts with tabs, but document is space-indented
LINE 55: Line starts with tabs, but document is space-indented
LINE 56: Line starts with tabs, but document is space-indented
LINE 62: Line starts with tabs, but document is space-indented
LINE 63: Line starts with tabs, but document is space-indented
LINE 69: Line starts with tabs, but document is space-indented
LINE 70: Line starts with tabs, but document is space-indented
LINE 76: Line starts with tabs, but document is space-indented
LINE 77: Line starts with tabs, but document is space-indented
LINE 134: Line starts with tabs, but document is space-indented
LINE 1:572 of macro [ABSTRACT]: Saw an end tag </a>, but there's no open element corresponding to it.
Open tags: <p> at 1:1 of macro [ABSTRACT]
LINE 48:2: Image doesn't exist, so I couldn't determine its width and height: 'images/module-layout2.gif'
Expand Down
6 changes: 3 additions & 3 deletions tests/github/WICG/keyboard-lock/index.console.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
WARNING: You used Status CG-DRAFT, but your Group (WEBPLATFORM) is limited to the statuses CR, CRD, CRY, CRYD, DRY, ED, FPWD, LCWD, LS, MO, NOTE, NOTE-ED, NOTE-FPWD, NOTE-WD, PER, PR, REC, RY, UD, WD, or WG-NOTE.
LINT: Your document appears to use tabs to indent, but line 40 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 41 starts with spaces.
LINT: Your document appears to use tabs to indent, but line 54 starts with spaces.
LINE 40: Line starts with spaces, but document is tab-indented
LINE 41: Line starts with spaces, but document is tab-indented
LINE 54: Line starts with spaces, but document is tab-indented
LINE 126:28: Unexported dfn that's not referenced locally - did you mean to export it?
<dfn bs-line-number="126:28" data-dfn-type="dfn" data-dfn-for="Keyboard" id="keyboard-lock" data-lt="lock()" data-noexport="by-default" class="dfn-paneled">lock()</dfn>
LINE 213:30: Unexported dfn that's not referenced locally - did you mean to export it?
Expand Down
22 changes: 11 additions & 11 deletions tests/github/WICG/responsive-image-client-hints/index.console.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
LINT: Your document appears to use spaces to indent, but line 35 starts with tabs.
LINT: Your document appears to use spaces to indent, but line 36 starts with tabs.
LINT: Your document appears to use spaces to indent, but line 37 starts with tabs.
LINT: Your document appears to use spaces to indent, but line 38 starts with tabs.
LINT: Your document appears to use spaces to indent, but line 41 starts with tabs.
LINT: Your document appears to use spaces to indent, but line 42 starts with tabs.
LINT: Your document appears to use spaces to indent, but line 43 starts with tabs.
LINT: Your document appears to use spaces to indent, but line 44 starts with tabs.
LINT: Your document appears to use spaces to indent, but line 53 starts with tabs.
LINT: Your document appears to use spaces to indent, but line 54 starts with tabs.
LINT: Your document appears to use spaces to indent, but line 55 starts with tabs.
LINE 35: Line starts with tabs, but document is space-indented
LINE 36: Line starts with tabs, but document is space-indented
LINE 37: Line starts with tabs, but document is space-indented
LINE 38: Line starts with tabs, but document is space-indented
LINE 41: Line starts with tabs, but document is space-indented
LINE 42: Line starts with tabs, but document is space-indented
LINE 43: Line starts with tabs, but document is space-indented
LINE 44: Line starts with tabs, but document is space-indented
LINE 53: Line starts with tabs, but document is space-indented
LINE 54: Line starts with tabs, but document is space-indented
LINE 55: Line starts with tabs, but document is space-indented
LINE 74:432: No 'dfn' refs found for 'density-corrected intrinsic width and height'.
<a bs-line-number="74:432" data-link-spec="html" data-lt="density-corrected intrinsic width and height" data-link-type="dfn">density-corrected intrinsic width</a>
LINE 101:12: Multiple possible 'px' maybe refs for '['<length>']'.
Expand Down
Loading

0 comments on commit 50d0ec7

Please sign in to comment.