Skip to content

Commit e4dd62a

Browse files
Publish to live (#94)
* (AB-4960) Run expectations workflow every 30m (#89) This change reduces the frequency the expectations GHA runs from once every 10 minutes to once every 30 minutes to help reduce the frequency of rate limiting. * (GH-90) Document PSAvoidUsingBrokenHashAlgorithms (#91) This change: - documents the new `PSAvoidUsingBrokenHashAlgorithms` rule for **PSScriptAnalyzer** by updating the rule table and adding a document for the rule. - Resolves #90 - Fixes AB#4996 * (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. * Add CrescendoBuilt to docs (#93) * Fix typos (#95) Co-authored-by: Mikey Lombardi (He/Him) <[email protected]>
1 parent 964c3a6 commit e4dd62a

File tree

11 files changed

+301
-45
lines changed

11 files changed

+301
-45
lines changed

.github/workflows/expectations.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
name: Commenting
66
on:
77
schedule:
8-
- cron: 0/10 * * * *
8+
- cron: 0/30 * * * *
99
permissions:
1010
contents: read
1111
pull-requests: write

.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: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
description: Avoid using broken hash algorithms
3+
ms.custom: PSSA v1.21.0
4+
ms.date: 05/31/2022
5+
ms.topic: reference
6+
title: AvoidUsingBrokenHashAlgorithms
7+
---
8+
# AvoidUsingBrokenHashAlgorithms
9+
10+
**Severity Level: Warning**
11+
12+
## Description
13+
14+
Avoid using the broken algorithms MD5 or SHA-1.
15+
16+
## How
17+
18+
Replace broken algorithms with secure alternatives. MD5 and SHA-1 should be replaced with SHA256,
19+
SHA384, SHA512, or other safer algorithms when possible, with MD5 and SHA-1 only being utilized by
20+
necessity for backwards compatibility.
21+
22+
## Example 1
23+
24+
### Wrong
25+
26+
```powershell
27+
Get-FileHash foo.txt -Algorithm MD5
28+
```
29+
30+
### Correct
31+
32+
```powershell
33+
Get-FileHash foo.txt -Algorithm SHA256
34+
```
35+
36+
## Example 2
37+
38+
### Wrong
39+
40+
```powershell
41+
Get-FileHash foo.txt -Algorithm SHA1
42+
```
43+
44+
### Correct
45+
46+
```powershell
47+
Get-FileHash foo.txt
48+
```

reference/docs-conceptual/PSScriptAnalyzer/Rules/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ The PSScriptAnalyzer contains the following rule definitions.
2626
| [AvoidSemicolonsAsLineTerminators](./AvoidSemicolonsAsLineTerminators.md) | Warning | No | |
2727
| [AvoidShouldContinueWithoutForce](./AvoidShouldContinueWithoutForce.md) | Warning | Yes | |
2828
| [AvoidTrailingWhitespace](./AvoidTrailingWhitespace.md) | Warning | Yes | |
29+
| [AvoidUsingBrokenHashAlgorithms](./AvoidUsingBrokenHashAlgorithms.md) | Warning | Yes | |
2930
| [AvoidUsingCmdletAliases](./AvoidUsingCmdletAliases.md) | Warning | Yes | Yes<sup>2</sup> |
3031
| [AvoidUsingComputerNameHardcoded](./AvoidUsingComputerNameHardcoded.md) | Error | Yes | |
3132
| [AvoidUsingConvertToSecureStringWithPlainText](./AvoidUsingConvertToSecureStringWithPlainText.md) | Error | Yes | |

reference/docs-conceptual/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ items:
7171
href: PSScriptAnalyzer/Rules/AvoidShouldContinueWithoutForce.md
7272
- name: AvoidTrailingWhitespace
7373
href: PSScriptAnalyzer/Rules/AvoidTrailingWhitespace.md
74+
- name: AvoidUsingBrokenHashAlgorithms
75+
href: PSScriptAnalyzer/Rules/AvoidUsingBrokenHashAlgorithms.md
7476
- name: AvoidUsingCmdletAliases
7577
href: PSScriptAnalyzer/Rules/AvoidUsingCmdletAliases.md
7678
- name: AvoidUsingComputerNameHardcoded
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)