mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-02-27 07:14:06 +01:00
Update MD009/no-trailing-spaces with code_blocks parameter to allow reporting/fixing trailing spaces in indented/fenced code blocks (fixes #1181).
Some checks are pending
Checkers / linkcheck (push) Waiting to run
Checkers / spellcheck (push) Waiting to run
CI / build (20, macos-latest) (push) Waiting to run
CI / build (20, ubuntu-latest) (push) Waiting to run
CI / build (20, windows-latest) (push) Waiting to run
CI / build (22, macos-latest) (push) Waiting to run
CI / build (22, ubuntu-latest) (push) Waiting to run
CI / build (22, windows-latest) (push) Waiting to run
CI / build (24, macos-latest) (push) Waiting to run
CI / build (24, ubuntu-latest) (push) Waiting to run
CI / build (24, windows-latest) (push) Waiting to run
CI / pnpm (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
TestRepos / build (latest, ubuntu-latest) (push) Waiting to run
UpdateTestRepos / update (push) Waiting to run
Some checks are pending
Checkers / linkcheck (push) Waiting to run
Checkers / spellcheck (push) Waiting to run
CI / build (20, macos-latest) (push) Waiting to run
CI / build (20, ubuntu-latest) (push) Waiting to run
CI / build (20, windows-latest) (push) Waiting to run
CI / build (22, macos-latest) (push) Waiting to run
CI / build (22, ubuntu-latest) (push) Waiting to run
CI / build (22, windows-latest) (push) Waiting to run
CI / build (24, macos-latest) (push) Waiting to run
CI / build (24, ubuntu-latest) (push) Waiting to run
CI / build (24, windows-latest) (push) Waiting to run
CI / pnpm (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
TestRepos / build (latest, ubuntu-latest) (push) Waiting to run
UpdateTestRepos / update (push) Waiting to run
This commit is contained in:
parent
7beb9fc9d0
commit
a55d5499e2
16 changed files with 590 additions and 34 deletions
|
|
@ -75772,6 +75772,427 @@ Generated by [AVA](https://avajs.dev).
|
|||
`,
|
||||
}
|
||||
|
||||
## trailing-spaces-in-code-default.md
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
{
|
||||
errors: [
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: 0 or 2; Actual: 1',
|
||||
errorRange: [
|
||||
14,
|
||||
1,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 14,
|
||||
},
|
||||
lineNumber: 4,
|
||||
ruleDescription: 'Trailing spaces',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md',
|
||||
ruleNames: [
|
||||
'MD009',
|
||||
'no-trailing-spaces',
|
||||
],
|
||||
severity: 'error',
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: 0 or 2; Actual: 3',
|
||||
errorRange: [
|
||||
14,
|
||||
3,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 3,
|
||||
editColumn: 14,
|
||||
},
|
||||
lineNumber: 6,
|
||||
ruleDescription: 'Trailing spaces',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md',
|
||||
ruleNames: [
|
||||
'MD009',
|
||||
'no-trailing-spaces',
|
||||
],
|
||||
severity: 'error',
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: 0 or 2; Actual: 4',
|
||||
errorRange: [
|
||||
14,
|
||||
4,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 4,
|
||||
editColumn: 14,
|
||||
},
|
||||
lineNumber: 7,
|
||||
ruleDescription: 'Trailing spaces',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md',
|
||||
ruleNames: [
|
||||
'MD009',
|
||||
'no-trailing-spaces',
|
||||
],
|
||||
severity: 'error',
|
||||
},
|
||||
],
|
||||
fixed: `# Trailing Spaces in Code - Default␊
|
||||
␊
|
||||
const a = 10;␊
|
||||
const b = 10;␊
|
||||
const c = 10; ␊
|
||||
const d = 10;␊
|
||||
const e = 10;␊
|
||||
␊
|
||||
{MD009:-5} {MD009:-3} {MD009:-2}␊
|
||||
␊
|
||||
const a = 10;␊
|
||||
const b = 10; ␊
|
||||
const c = 10; ␊
|
||||
const d = 10; ␊
|
||||
const e = 10; ␊
|
||||
␊
|
||||
\`\`\`js␊
|
||||
const a = 10;␊
|
||||
const b = 10; ␊
|
||||
const c = 10; ␊
|
||||
const d = 10; ␊
|
||||
const e = 10; ␊
|
||||
\`\`\`␊
|
||||
␊
|
||||
<!-- markdownlint-configure-file {␊
|
||||
"code-block-style": false␊
|
||||
} -->␊
|
||||
`,
|
||||
}
|
||||
|
||||
## trailing-spaces-in-code-false.md
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
{
|
||||
errors: [
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: 0 or 2; Actual: 1',
|
||||
errorRange: [
|
||||
14,
|
||||
1,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 14,
|
||||
},
|
||||
lineNumber: 4,
|
||||
ruleDescription: 'Trailing spaces',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md',
|
||||
ruleNames: [
|
||||
'MD009',
|
||||
'no-trailing-spaces',
|
||||
],
|
||||
severity: 'error',
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: 0 or 2; Actual: 3',
|
||||
errorRange: [
|
||||
14,
|
||||
3,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 3,
|
||||
editColumn: 14,
|
||||
},
|
||||
lineNumber: 6,
|
||||
ruleDescription: 'Trailing spaces',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md',
|
||||
ruleNames: [
|
||||
'MD009',
|
||||
'no-trailing-spaces',
|
||||
],
|
||||
severity: 'error',
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: 0 or 2; Actual: 4',
|
||||
errorRange: [
|
||||
14,
|
||||
4,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 4,
|
||||
editColumn: 14,
|
||||
},
|
||||
lineNumber: 7,
|
||||
ruleDescription: 'Trailing spaces',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md',
|
||||
ruleNames: [
|
||||
'MD009',
|
||||
'no-trailing-spaces',
|
||||
],
|
||||
severity: 'error',
|
||||
},
|
||||
],
|
||||
fixed: `# Trailing Spaces in Code - False␊
|
||||
␊
|
||||
const a = 10;␊
|
||||
const b = 10;␊
|
||||
const c = 10; ␊
|
||||
const d = 10;␊
|
||||
const e = 10;␊
|
||||
␊
|
||||
{MD009:-5} {MD009:-3} {MD009:-2}␊
|
||||
␊
|
||||
const a = 10;␊
|
||||
const b = 10; ␊
|
||||
const c = 10; ␊
|
||||
const d = 10; ␊
|
||||
const e = 10; ␊
|
||||
␊
|
||||
\`\`\`js␊
|
||||
const a = 10;␊
|
||||
const b = 10; ␊
|
||||
const c = 10; ␊
|
||||
const d = 10; ␊
|
||||
const e = 10; ␊
|
||||
\`\`\`␊
|
||||
␊
|
||||
<!-- markdownlint-configure-file {␊
|
||||
"code-block-style": false,␊
|
||||
"no-trailing-spaces": {␊
|
||||
"code_blocks": false␊
|
||||
}␊
|
||||
} -->␊
|
||||
`,
|
||||
}
|
||||
|
||||
## trailing-spaces-in-code-true.md
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
{
|
||||
errors: [
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: 0 or 2; Actual: 1',
|
||||
errorRange: [
|
||||
14,
|
||||
1,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 14,
|
||||
},
|
||||
lineNumber: 4,
|
||||
ruleDescription: 'Trailing spaces',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md',
|
||||
ruleNames: [
|
||||
'MD009',
|
||||
'no-trailing-spaces',
|
||||
],
|
||||
severity: 'error',
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: 0 or 2; Actual: 3',
|
||||
errorRange: [
|
||||
14,
|
||||
3,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 3,
|
||||
editColumn: 14,
|
||||
},
|
||||
lineNumber: 6,
|
||||
ruleDescription: 'Trailing spaces',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md',
|
||||
ruleNames: [
|
||||
'MD009',
|
||||
'no-trailing-spaces',
|
||||
],
|
||||
severity: 'error',
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: 0 or 2; Actual: 4',
|
||||
errorRange: [
|
||||
14,
|
||||
4,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 4,
|
||||
editColumn: 14,
|
||||
},
|
||||
lineNumber: 7,
|
||||
ruleDescription: 'Trailing spaces',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md',
|
||||
ruleNames: [
|
||||
'MD009',
|
||||
'no-trailing-spaces',
|
||||
],
|
||||
severity: 'error',
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: 0 or 2; Actual: 1',
|
||||
errorRange: [
|
||||
18,
|
||||
1,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 18,
|
||||
},
|
||||
lineNumber: 12,
|
||||
ruleDescription: 'Trailing spaces',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md',
|
||||
ruleNames: [
|
||||
'MD009',
|
||||
'no-trailing-spaces',
|
||||
],
|
||||
severity: 'error',
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: 0 or 2; Actual: 3',
|
||||
errorRange: [
|
||||
18,
|
||||
3,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 3,
|
||||
editColumn: 18,
|
||||
},
|
||||
lineNumber: 14,
|
||||
ruleDescription: 'Trailing spaces',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md',
|
||||
ruleNames: [
|
||||
'MD009',
|
||||
'no-trailing-spaces',
|
||||
],
|
||||
severity: 'error',
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: 0 or 2; Actual: 4',
|
||||
errorRange: [
|
||||
18,
|
||||
4,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 4,
|
||||
editColumn: 18,
|
||||
},
|
||||
lineNumber: 15,
|
||||
ruleDescription: 'Trailing spaces',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md',
|
||||
ruleNames: [
|
||||
'MD009',
|
||||
'no-trailing-spaces',
|
||||
],
|
||||
severity: 'error',
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: 0 or 2; Actual: 1',
|
||||
errorRange: [
|
||||
14,
|
||||
1,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 14,
|
||||
},
|
||||
lineNumber: 21,
|
||||
ruleDescription: 'Trailing spaces',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md',
|
||||
ruleNames: [
|
||||
'MD009',
|
||||
'no-trailing-spaces',
|
||||
],
|
||||
severity: 'error',
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: 0 or 2; Actual: 3',
|
||||
errorRange: [
|
||||
14,
|
||||
3,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 3,
|
||||
editColumn: 14,
|
||||
},
|
||||
lineNumber: 23,
|
||||
ruleDescription: 'Trailing spaces',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md',
|
||||
ruleNames: [
|
||||
'MD009',
|
||||
'no-trailing-spaces',
|
||||
],
|
||||
severity: 'error',
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: 0 or 2; Actual: 4',
|
||||
errorRange: [
|
||||
14,
|
||||
4,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 4,
|
||||
editColumn: 14,
|
||||
},
|
||||
lineNumber: 24,
|
||||
ruleDescription: 'Trailing spaces',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md',
|
||||
ruleNames: [
|
||||
'MD009',
|
||||
'no-trailing-spaces',
|
||||
],
|
||||
severity: 'error',
|
||||
},
|
||||
],
|
||||
fixed: `# Trailing Spaces in Code - True␊
|
||||
␊
|
||||
const a = 10;␊
|
||||
const b = 10;␊
|
||||
const c = 10; ␊
|
||||
const d = 10;␊
|
||||
const e = 10;␊
|
||||
␊
|
||||
{MD009:-5} {MD009:-3} {MD009:-2}␊
|
||||
␊
|
||||
const a = 10;␊
|
||||
const b = 10;␊
|
||||
const c = 10; ␊
|
||||
const d = 10;␊
|
||||
const e = 10;␊
|
||||
␊
|
||||
{MD009:-5} {MD009:-3} {MD009:-2}␊
|
||||
␊
|
||||
\`\`\`js␊
|
||||
const a = 10;␊
|
||||
const b = 10;␊
|
||||
const c = 10; ␊
|
||||
const d = 10;␊
|
||||
const e = 10;␊
|
||||
\`\`\`␊
|
||||
␊
|
||||
{MD009:-6} {MD009:-4} {MD009:-3}␊
|
||||
␊
|
||||
<!-- markdownlint-configure-file {␊
|
||||
"code-block-style": false,␊
|
||||
"no-trailing-spaces": {␊
|
||||
"code_blocks": true␊
|
||||
}␊
|
||||
} -->␊
|
||||
`,
|
||||
}
|
||||
|
||||
## trailing-spaces-in-lists-allowed-strict.md
|
||||
|
||||
> Snapshot 1
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue