Skip to content

Commit e74c14a

Browse files
(AB-4196) Codify markdownlint (#92)
Prior to this change, the repository had no markdownlint configuration. This change adds configuration based on the rules defined in the MicrosoftDocs/PowerShell-Docs project. The root-folder `.markdownlint.json` file specifies the enforced syntax for Markdown files in this project. The root-folder `.markdownlint-cli2.yaml` file governs the behavior of the linter overall. The settings included are minimal and do not effect the editing experience. This file may require iteration for advanced usage later. In every `About` folder for reference content, this change adds a `.markdownlint.json` file. When editing Markdown in VS Code, the editor uses the closest configuration file to the edited document. That allows us to override and specify alternate rules on a per-folder basis. In this change, the configuration files in the `About` folders: - Extend the root configuration. Any settings not specified in these configurations is inherited from the configuration at the project root. - Overrides the `line-length` rule, setting the maximum line length for code blocks to 74 characters and for other text to 79 characters.This is to accomodate the PowerShell Help System's line length requirements. In the `rules` folder for PSScriptAnalyzer's conceptual content, this change adds a `.markdownlint.json` file which ignores the markdownlint rule `no-emphasis-as-heading`. PSSA rules indicate their severity level by a single line of emphasized text. This change is related to AB#4196 and AB#4197.
1 parent 03065d1 commit e74c14a

File tree

5 files changed

+193
-0
lines changed

5 files changed

+193
-0
lines changed

.markdownlint-cli2.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Rule definitions live in .markdownlint.json
2+
3+
# Include a custom rule package
4+
# customRules:
5+
# - markdownlint-rule-titlecase
6+
7+
# Fix any fixable errors
8+
fix: true
9+
10+
# Define a custom front matter pattern
11+
# frontMatter: (^---\s*$[^]*?^---\s*$)(\r\n|\r|\n|$)
12+
13+
# Define glob expressions to use (only valid at root)
14+
# globs:
15+
# - "!*bout.md"
16+
17+
# Define glob expressions to ignore
18+
ignores:
19+
- breadcrumb
20+
21+
# Use a plugin to recognize math
22+
# markdownItPlugins:
23+
# - - "@iktakahiro/markdown-it-katex"
24+
25+
# Disable inline config comments
26+
noInlineConfig: false
27+
28+
# Disable progress on stdout (only valid at root)
29+
noProgress: true
30+
31+
# Use a specific formatter (only valid at root)
32+
# outputFormatters:
33+
# - [markdownlint-cli2-formatter-default]

.markdownlint.json

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
{
2+
"blanks-around-fences": true,
3+
"blanks-around-headers": true,
4+
"blanks-around-lists": true,
5+
"code-block-style": {
6+
"style": "fenced"
7+
},
8+
"code-fence-style": {
9+
"style": "backtick"
10+
},
11+
"commands-show-output": true,
12+
"docsmd.alert": true,
13+
"docsmd.codesnippet": true,
14+
"docsmd.column": true,
15+
"docsmd.image": true,
16+
"docsmd.moniker": true,
17+
"docsmd.no-loc": true,
18+
"docsmd.row": true,
19+
"docsmd.securelinks": true,
20+
"docsmd.syntax": true,
21+
"docsmd.video": true,
22+
"docsmd.xref": true,
23+
"docsmd.zone": true,
24+
"emphasis-style": {
25+
"style": "underscore"
26+
},
27+
"fenced-code-language": false,
28+
"first-line-h1": {
29+
"front_matter_title": ""
30+
},
31+
"header-increment": true,
32+
"header-start-left": true,
33+
"header-style": {
34+
"style": "atx"
35+
},
36+
"hr-style": {
37+
"style": "---"
38+
},
39+
"line-length": {
40+
"code_block_line_length": 90,
41+
"code_blocks": true,
42+
"heading_line_length": 100,
43+
"headings": true,
44+
"line_length": 100,
45+
"stern": true,
46+
"tables": false
47+
},
48+
"list-indent": true,
49+
"list-marker-space": true,
50+
"no-alt-text": true,
51+
"no-bare-urls": true,
52+
"no-blanks-blockquote": true,
53+
"no-duplicate-header": {
54+
"siblings_only": true
55+
},
56+
"no-emphasis-as-header": true,
57+
"no-empty-links": true,
58+
"no-hard-tabs": true,
59+
"no-inline-html": {
60+
"allowed_elements": [
61+
"a",
62+
"br",
63+
"code",
64+
"kbd",
65+
"li",
66+
"properties",
67+
"sup",
68+
"tags",
69+
"ul"
70+
]
71+
},
72+
"no-missing-space-atx": true,
73+
"no-missing-space-closed-atx": true,
74+
"no-multiple-blanks": true,
75+
"no-multiple-space-atx": true,
76+
"no-multiple-space-blockquote": true,
77+
"no-multiple-space-closed-atx": true,
78+
"no-reversed-links": true,
79+
"no-space-in-code": true,
80+
"no-space-in-emphasis": true,
81+
"no-space-in-links": true,
82+
"no-trailing-punctuation": {
83+
"punctuation": ".,;:!。,;:!?"
84+
},
85+
"no-trailing-spaces": {
86+
"br_spaces": 2,
87+
"strict": true
88+
},
89+
"ol-prefix": {
90+
"style": "one"
91+
},
92+
"proper-names": {
93+
"code_blocks": false,
94+
"names": [
95+
"PowerShell",
96+
"IntelliSense",
97+
"Authenticode",
98+
"CentOS",
99+
"Contoso",
100+
"CoreOS",
101+
"Debian",
102+
"Ubuntu",
103+
"openSUSE",
104+
"RHEL",
105+
"JavaScript",
106+
".NET",
107+
"NuGet",
108+
"VS Code",
109+
"Newtonsoft"
110+
]
111+
},
112+
"required-headers": false,
113+
"single-h1": {
114+
"front_matter_title": "",
115+
"level": 1
116+
},
117+
"single-trailing-newline": true,
118+
"strong-style": {
119+
"style": "asterisk"
120+
},
121+
"ul-indent": {
122+
"indent": 2,
123+
"start_indented": false
124+
},
125+
"ul-start-left": true,
126+
"ul-style": {
127+
"style": "dash"
128+
},
129+
"link-fragments": true,
130+
"reference-links-images": true,
131+
"link-image-reference-definitions": true
132+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "../../../../.markdownlint.json",
3+
"no-emphasis-as-heading": false
4+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "../../../../.markdownlint.json",
3+
"line-length": {
4+
"code_block_line_length": 74,
5+
"code_blocks": true,
6+
"heading_line_length": 79,
7+
"headings": true,
8+
"line_length": 79,
9+
"stern": true,
10+
"tables": false
11+
}
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "../../../../.markdownlint.json",
3+
"line-length": {
4+
"code_block_line_length": 74,
5+
"code_blocks": true,
6+
"heading_line_length": 79,
7+
"headings": true,
8+
"line_length": 79,
9+
"stern": true,
10+
"tables": false
11+
}
12+
}

0 commit comments

Comments
 (0)