Skip to content

Commit

Permalink
Switch from using markdownlint-rule-titlecase in tests to markdownlin…
Browse files Browse the repository at this point in the history
…t-rule-extended-ascii (0 dependencies), include new rule in Dockerfile-rules.
  • Loading branch information
DavidAnson committed May 15, 2024
1 parent 626b637 commit e5b85ff
Show file tree
Hide file tree
Showing 17 changed files with 25 additions and 28 deletions.
1 change: 1 addition & 0 deletions docker/Dockerfile-rules
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ USER root
RUN npm install --global --no-package-lock --production \
@github/markdownlint-github \
markdownlint-rule-enhanced-proper-names \
markdownlint-rule-extended-ascii \
markdownlint-rule-github-admonition \
markdownlint-rule-github-internal-links \
markdownlint-rule-header-id \
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"markdownlint-cli2-formatter-pretty": "0.0.5",
"markdownlint-cli2-formatter-sarif": "0.0.1",
"markdownlint-cli2-formatter-summarize": "0.0.6",
"markdownlint-rule-titlecase": "0.1.0",
"markdownlint-rule-extended-ascii": "0.1.0",
"npm-run-all": "4.1.5"
},
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion test/customRules/dir/subdir/.markdownlint-cli2.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"../../rules/first-line.js",
"../../node_modules/markdownlint-rule-sample-commonjs",
"../../node_modules/markdownlint-rule-sample-module/sample-rule.mjs",
"markdownlint-rule-titlecase"
"markdownlint-rule-extended-ascii"
]
}
2 changes: 1 addition & 1 deletion test/customRules/dir/subdir/hr.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# hr
# HR ✅

---
2 changes: 1 addition & 1 deletion test/formatter-pretty-appendLink/.markdownlint-cli2.jsonc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"customRules": [
"markdownlint-rule-titlecase"
"markdownlint-rule-extended-ascii"
],
"outputFormatters": [
[ "../../formatter-pretty", { "appendLink": true } ]
Expand Down
2 changes: 1 addition & 1 deletion test/formatter-pretty-appendLink/viewme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# title
# Title ✅

> Tagline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// Include a custom rule package
"customRules": [
"markdownlint-rule-titlecase"
"markdownlint-rule-extended-ascii"
],

// Fix any fixable errors
Expand Down
1 change: 1 addition & 0 deletions test/markdownlint-cli2-jsonc-example/extended-ascii.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Title ✅
3 changes: 0 additions & 3 deletions test/markdownlint-cli2-jsonc-example/title-case.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ config:

# Include a custom rule package
customRules:
- markdownlint-rule-titlecase
- markdownlint-rule-extended-ascii

# Fix any fixable errors
fix: true
Expand Down
1 change: 1 addition & 0 deletions test/markdownlint-cli2-yaml-example/extended-ascii.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Title ✅
3 changes: 0 additions & 3 deletions test/markdownlint-cli2-yaml-example/title-case.md

This file was deleted.

16 changes: 8 additions & 8 deletions test/merge-options-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test("full/empty", (t) => {
"no-trailing-spaces": false,
"no-multiple-blanks": false
},
"customRules": [ "markdownlint-rule-titlecase" ],
"customRules": [ "markdownlint-rule-extended-ascii" ],
"fix": true
},
{}
Expand All @@ -40,7 +40,7 @@ test("full/empty", (t) => {
"no-trailing-spaces": false,
"no-multiple-blanks": false
},
"customRules": [ "markdownlint-rule-titlecase" ],
"customRules": [ "markdownlint-rule-extended-ascii" ],
"fix": true
}
);
Expand All @@ -56,7 +56,7 @@ test("empty/full", (t) => {
"no-trailing-spaces": false,
"no-multiple-blanks": false
},
"customRules": [ "markdownlint-rule-titlecase" ],
"customRules": [ "markdownlint-rule-extended-ascii" ],
"fix": true
}
),
Expand All @@ -65,7 +65,7 @@ test("empty/full", (t) => {
"no-trailing-spaces": false,
"no-multiple-blanks": false
},
"customRules": [ "markdownlint-rule-titlecase" ],
"customRules": [ "markdownlint-rule-extended-ascii" ],
"fix": true
}
);
Expand All @@ -79,7 +79,7 @@ test("partial/partial merge", (t) => {
"config": {
"no-trailing-spaces": false
},
"customRules": [ "markdownlint-rule-titlecase" ]
"customRules": [ "markdownlint-rule-extended-ascii" ]
},
{
"config": {
Expand All @@ -93,7 +93,7 @@ test("partial/partial merge", (t) => {
"no-trailing-spaces": false,
"no-multiple-blanks": false
},
"customRules": [ "markdownlint-rule-titlecase" ],
"customRules": [ "markdownlint-rule-extended-ascii" ],
"fix": true
}
);
Expand All @@ -116,7 +116,7 @@ test("full/full replace", (t) => {
"no-trailing-spaces": false,
"no-multiple-blanks": false
},
"customRules": [ "markdownlint-rule-titlecase" ],
"customRules": [ "markdownlint-rule-extended-ascii" ],
"fix": true
}
),
Expand All @@ -125,7 +125,7 @@ test("full/full replace", (t) => {
"no-trailing-spaces": false,
"no-multiple-blanks": false
},
"customRules": [ "markdownlint-rule-titlecase" ],
"customRules": [ "markdownlint-rule-extended-ascii" ],
"fix": true
}
);
Expand Down
8 changes: 4 additions & 4 deletions test/snapshots/markdownlint-cli2-test-exec.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,7 @@ Generated by [AVA](https://avajs.dev).
formatterJson: '',
formatterJunit: '',
formatterSarif: '',
stderr: `title-case.md:1:1 titlecase-rule Titlecase rule [Title Case: 'Expected # Heading, found # heading']␊
stderr: `extended-ascii.md:1:9 extended-ascii Only extended ASCII characters are allowed [Blocked character: '✅']␊
viewme.md:6 MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "# Description"]␊
`,
stdout: '',
Expand Down Expand Up @@ -1243,7 +1243,7 @@ Generated by [AVA](https://avajs.dev).
formatterJson: '',
formatterJunit: '',
formatterSarif: '',
stderr: `title-case.md:1:1 titlecase-rule Titlecase rule [Title Case: 'Expected # Heading, found # heading']␊
stderr: `extended-ascii.md:1:9 extended-ascii Only extended ASCII characters are allowed [Blocked character: '✅']␊
viewme.md:6 MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "# Description"]␊
`,
stdout: '',
Expand Down Expand Up @@ -2817,8 +2817,8 @@ Generated by [AVA](https://avajs.dev).
dir/about.md:4 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "1. List"]␊
dir/about.md:5:1 MD029/ol-prefix Ordered list item prefix [Expected: 2; Actual: 3; Style: 1/2/3]␊
dir/about.md:6 every-n-lines Rule that reports an error every N lines [Line number 6]␊
dir/subdir/hr.md:1:6 extended-ascii Only extended ASCII characters are allowed [Blocked character: '✅']␊
dir/subdir/hr.md:1 first-line Rule that reports an error for the first line␊
dir/subdir/hr.md:1:1 titlecase-rule Titlecase rule [Title Case: 'Expected # Hr, found # hr']␊
dir/subdir/hr.md:3 sample-rule-commonjs Sample rule (commonjs) [Sample error for hr]␊
dir/subdir/hr.md:3 sample-rule-module Sample rule (module) [Sample error for hr]␊
dir/subdir/info.md:1 first-line Rule that reports an error for the first line␊
Expand Down Expand Up @@ -5866,7 +5866,7 @@ Generated by [AVA](https://avajs.dev).
dir/subdir/info.md:2:6 MD038/no-space-in-code Spaces inside code span elements [Context: "\` code1\`"] https://github.com/DavidAnson/markdownlint/blob/vX.Y.Z/doc/md038.md␊
dir/subdir/info.md:2:20 MD038/no-space-in-code Spaces inside code span elements [Context: "\`code2 \`"] https://github.com/DavidAnson/markdownlint/blob/vX.Y.Z/doc/md038.md␊
dir/subdir/info.md:4 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2] https://github.com/DavidAnson/markdownlint/blob/vX.Y.Z/doc/md012.md␊
[35mviewme.md[39m[36m:[39m[32m1[39m[36m:[39m[32m1[39m [90mtitlecase-rule[39m Titlecase rule[90m [Title Case: 'Expected # Title, found # title'][39m␊
[35mviewme.md[39m[36m:[39m[32m1[39m[36m:[39m[32m9[39m [90mextended-ascii[39m Only extended ASCII characters are allowed[90m [Blocked character: ''][39m␊
viewme.md:3:10 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/vX.Y.Z/doc/md009.md␊
viewme.md:5 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2] https://github.com/DavidAnson/markdownlint/blob/vX.Y.Z/doc/md012.md␊
viewme.md:6 MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "# Description"] https://github.com/DavidAnson/markdownlint/blob/vX.Y.Z/doc/md025.md␊
Expand Down
Binary file modified test/snapshots/markdownlint-cli2-test-exec.js.snap
Binary file not shown.
6 changes: 3 additions & 3 deletions test/snapshots/markdownlint-cli2-test-main.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,7 @@ Generated by [AVA](https://avajs.dev).
formatterJson: '',
formatterJunit: '',
formatterSarif: '',
stderr: `title-case.md:1:1 titlecase-rule Titlecase rule [Title Case: 'Expected # Heading, found # heading']␊
stderr: `extended-ascii.md:1:9 extended-ascii Only extended ASCII characters are allowed [Blocked character: '✅']␊
viewme.md:6 MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "# Description"]␊
`,
stdout: '',
Expand Down Expand Up @@ -1243,7 +1243,7 @@ Generated by [AVA](https://avajs.dev).
formatterJson: '',
formatterJunit: '',
formatterSarif: '',
stderr: `title-case.md:1:1 titlecase-rule Titlecase rule [Title Case: 'Expected # Heading, found # heading']␊
stderr: `extended-ascii.md:1:9 extended-ascii Only extended ASCII characters are allowed [Blocked character: '✅']␊
viewme.md:6 MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "# Description"]␊
`,
stdout: '',
Expand Down Expand Up @@ -2817,8 +2817,8 @@ Generated by [AVA](https://avajs.dev).
dir/about.md:4 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "1. List"]␊
dir/about.md:5:1 MD029/ol-prefix Ordered list item prefix [Expected: 2; Actual: 3; Style: 1/2/3]␊
dir/about.md:6 every-n-lines Rule that reports an error every N lines [Line number 6]␊
dir/subdir/hr.md:1:6 extended-ascii Only extended ASCII characters are allowed [Blocked character: '✅']␊
dir/subdir/hr.md:1 first-line Rule that reports an error for the first line␊
dir/subdir/hr.md:1:1 titlecase-rule Titlecase rule [Title Case: 'Expected # Hr, found # hr']␊
dir/subdir/hr.md:3 sample-rule-commonjs Sample rule (commonjs) [Sample error for hr]␊
dir/subdir/hr.md:3 sample-rule-module Sample rule (module) [Sample error for hr]␊
dir/subdir/info.md:1 first-line Rule that reports an error for the first line␊
Expand Down
Binary file modified test/snapshots/markdownlint-cli2-test-main.js.snap
Binary file not shown.

0 comments on commit e5b85ff

Please sign in to comment.