Add tests for MD013/line-length edge case behavior.
Some checks failed
Checkers / linkcheck (push) Has been cancelled
Checkers / spellcheck (push) Has been cancelled
CI / build (20, macos-latest) (push) Has been cancelled
CI / build (20, ubuntu-latest) (push) Has been cancelled
CI / build (20, windows-latest) (push) Has been cancelled
CI / build (22, macos-latest) (push) Has been cancelled
CI / build (22, ubuntu-latest) (push) Has been cancelled
CI / build (22, windows-latest) (push) Has been cancelled
CI / build (24, macos-latest) (push) Has been cancelled
CI / build (24, ubuntu-latest) (push) Has been cancelled
CI / build (24, windows-latest) (push) Has been cancelled
CI / pnpm (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
TestRepos / build (latest, ubuntu-latest) (push) Has been cancelled
UpdateTestRepos / update (push) Has been cancelled

This commit is contained in:
David Anson 2025-11-25 17:17:12 -08:00
parent b4df555e7c
commit eb83b49845
5 changed files with 187 additions and 1 deletions

View file

@ -42078,6 +42078,27 @@ Generated by [AVA](https://avajs.dev).
<!-- markdownlint-disable-file descriptive-link-text -->`,
}
## long-lines-negative-line-length.md
> Snapshot 1
{
errors: [],
fixed: `# Long Lines Negative Line Length␊
Text text text text text text text text text text text text text text text text text text text text.␊
This is an invalid configuration, but present in the wild and (for backward compatibility) disables the rule:␊
<https://github.com/electron/lint-roller/blob/1e062bda146160afb8eb232966287d5edb20e0a4/configs/markdownlint.json#L9>
<!-- markdownlint-configure-file {␊
"line-length": {␊
"line_length": -1␊
}␊
} -->␊
`,
}
## long-lines-short-code.md
> Snapshot 1
@ -42637,6 +42658,121 @@ Generated by [AVA](https://avajs.dev).
`,
}
## long-lines-thresholds.md
> Snapshot 1
{
errors: [
{
errorContext: null,
errorDetail: 'Expected: 40; Actual: 42',
errorRange: [
41,
2,
],
fixInfo: null,
lineNumber: 8,
ruleDescription: 'Line length',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md',
ruleNames: [
'MD013',
'line-length',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Expected: 30; Actual: 32',
errorRange: [
31,
2,
],
fixInfo: null,
lineNumber: 14,
ruleDescription: 'Line length',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md',
ruleNames: [
'MD013',
'line-length',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Expected: 20; Actual: 22',
errorRange: [
21,
2,
],
fixInfo: null,
lineNumber: 20,
ruleDescription: 'Line length',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md',
ruleNames: [
'MD013',
'line-length',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Expected: 20; Actual: 22',
errorRange: [
21,
2,
],
fixInfo: null,
lineNumber: 26,
ruleDescription: 'Line length',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md',
ruleNames: [
'MD013',
'line-length',
],
severity: 'error',
},
],
fixed: `# Long Lines Thresholds␊
00000000011111111112222222222333333333344444444445␊
12345678901234567890123456789012345678901234567890␊
Texxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx t␊
Texxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx t␊
{MD013:-2}␊
## Texxxxxxxxxxxxxxxxxxxxxxxx t␊
## Texxxxxxxxxxxxxxxxxxxxxxxxx t␊
{MD013:-2}␊
\`\`\`text␊
Texxxxxxxxxxxxxxxxx t␊
Texxxxxxxxxxxxxxxxxx t␊
\`\`\`␊
{MD013:-3}␊
Texxxxxxxxxxxxx t␊
Texxxxxxxxxxxxxx t␊
{MD013:-2}␊
<!-- markdownlint-configure-file {␊
"code-block-style": false,␊
"line-length": {␊
"line_length": 40,␊
"heading_line_length": 30,␊
"code_block_line_length": 20␊
}␊
} -->␊
`,
}
## long_lines.md
> Snapshot 1