Skip to content

Commit 604bdb8

Browse files
authored
style: drop trailing-whitespace and callout-blank-line format rules (#771)
1 parent 4ced86f commit 604bdb8

5 files changed

Lines changed: 3 additions & 45 deletions

File tree

.claude/skills/dify-docs-format-check-cjk/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ The script selects zh or ja rules based on the file path. Rules fall into three
5656
- `C-no-language`, `C-blank-before`, `C-blank-after` — code block rules.
5757
- `Li-click-here`, `Li-http-external` — link rules.
5858
- `I-raw-img-tag`, `I-alt-too-long`, `I-caption-alt-mismatch`, `I-filename-*` — image rules (same set as the EN skill).
59-
- `M-tab-no-title`, `M-component-blank-before`, `M-component-blank-after` — Mintlify component rules.
60-
- `S-double-blank`, `S-trailing-whitespace` — spacing.
59+
- `M-tab-no-title` — Mintlify component rules.
60+
- `S-double-blank` — spacing.
6161
- `P-em-dash-spaces`, `P-en-dash-spaces` — general punctuation.
6262

6363
**Shared CJK rules (zh + ja)**

.claude/skills/dify-docs-format-check-cjk/check-format-cjk.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,6 @@ def check_images(lines: list[str]) -> list[Violation]:
385385
def check_mintlify(lines: list[str]) -> list[Violation]:
386386
vs: list[Violation] = []
387387
in_fence = False
388-
callout_re = re.compile(r'^\s*<(Info|Tip|Note|Warning)\b[^>]*>',
389-
re.IGNORECASE)
390-
closer_re = re.compile(r'^\s*</(Info|Tip|Note|Warning)>\s*$',
391-
re.IGNORECASE)
392388
tab_re = re.compile(r'<Tab(?:\s+[^>]*)?>')
393389
tab_title_re = re.compile(r'\btitle\s*=\s*"[^"]*"')
394390
for i, line in enumerate(lines, 1):
@@ -397,13 +393,6 @@ def check_mintlify(lines: list[str]) -> list[Violation]:
397393
continue
398394
if in_fence:
399395
continue
400-
if callout_re.match(line) and i > 1 and lines[i - 2].strip() != '':
401-
vs.append(Violation(i, 'M-component-blank-before',
402-
'Missing blank line before callout.'))
403-
if closer_re.match(line) and i < len(lines) \
404-
and lines[i].strip() != '':
405-
vs.append(Violation(i, 'M-component-blank-after',
406-
'Missing blank line after callout.'))
407396
for m in tab_re.finditer(line):
408397
if not tab_title_re.search(m.group(0)):
409398
vs.append(Violation(i, 'M-tab-no-title',
@@ -429,9 +418,6 @@ def check_spacing(lines: list[str]) -> list[Violation]:
429418
'Consecutive blank lines.'))
430419
else:
431420
blank_run = 0
432-
if line != line.rstrip():
433-
vs.append(Violation(i, 'S-trailing-whitespace',
434-
'Line has trailing whitespace.'))
435421
return vs
436422

437423

.claude/skills/dify-docs-format-check-en/SKILL.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ The script checks these rules. Each violation includes the file path, line numbe
8888
**Mintlify Components**
8989

9090
- `M-tab-no-title``<Tab>` without a `title` attribute.
91-
- `M-component-blank-before` / `M-component-blank-after` — missing blank line around `<Info>`, `<Tip>`, `<Note>`, or `<Warning>`.
9291

9392
**UI Element References**
9493

@@ -97,7 +96,6 @@ The script checks these rules. Each violation includes the file path, line numbe
9796
**Spacing**
9897

9998
- `S-double-blank` — two or more consecutive blank lines.
100-
- `S-trailing-whitespace` — line ends with whitespace.
10199

102100
**Punctuation**
103101

.claude/skills/dify-docs-format-check-en/check-format-en.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,6 @@ def check_images(lines: list[str]) -> list[Violation]:
513513
def check_mintlify_components(lines: list[str]) -> list[Violation]:
514514
vs: list[Violation] = []
515515
in_fence = False
516-
callout_re = re.compile(r'^\s*<(Info|Tip|Note|Warning)\b[^>]*>', re.IGNORECASE)
517516
tab_no_title_re = re.compile(r'<Tab(?:\s+[^>]*)?>')
518517
tab_title_attr_re = re.compile(r'\btitle\s*=\s*"[^"]*"')
519518
for i, line in enumerate(lines, 1):
@@ -522,31 +521,11 @@ def check_mintlify_components(lines: list[str]) -> list[Violation]:
522521
continue
523522
if in_fence:
524523
continue
525-
if callout_re.match(line):
526-
if i > 1 and lines[i - 2].strip() != '':
527-
vs.append(Violation(
528-
i, 'M-component-blank-before',
529-
'Missing blank line before Mintlify callout.'))
530524
for m in tab_no_title_re.finditer(line):
531525
if not tab_title_attr_re.search(m.group(0)):
532526
vs.append(Violation(
533527
i, 'M-tab-no-title',
534528
'<Tab> element without a title attribute.'))
535-
# end-of-component blank
536-
closer_re = re.compile(r'^\s*</(Info|Tip|Note|Warning)>\s*$',
537-
re.IGNORECASE)
538-
in_fence = False
539-
for i, line in enumerate(lines, 1):
540-
if FENCE_RE.match(line):
541-
in_fence = not in_fence
542-
continue
543-
if in_fence:
544-
continue
545-
if closer_re.match(line):
546-
if i < len(lines) and lines[i].strip() != '':
547-
vs.append(Violation(
548-
i, 'M-component-blank-after',
549-
'Missing blank line after Mintlify callout.'))
550529
return vs
551530

552531

@@ -590,10 +569,6 @@ def check_spacing(lines: list[str]) -> list[Violation]:
590569
'Two or more consecutive blank lines.'))
591570
else:
592571
blank_run = 0
593-
if line != line.rstrip():
594-
vs.append(Violation(
595-
i, 'S-trailing-whitespace',
596-
'Line has trailing whitespace.'))
597572
return vs
598573

599574

writing-guides/formatting-guide.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ Configure at least one model provider in **System Settings** > **Model Providers
282282
</Info>
283283
```
284284

285-
- One blank line before and after the component.
286285
- Content inside can include bold, links, and other inline formatting.
287286

288287
### Tabs
@@ -380,7 +379,7 @@ Use for showing multiple code variants of the same operation:
380379

381380
## Spacing
382381

383-
- **One blank line** between paragraphs, before/after headings, before/after components, before/after code blocks.
382+
- **One blank line** between paragraphs, before/after headings, before/after code blocks.
384383
- **No double blank lines** anywhere in the file.
385384

386385
---

0 commit comments

Comments
 (0)