Skip to content

Commit

Permalink
Publish to live (#94)
Browse files Browse the repository at this point in the history
* (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]>
  • Loading branch information
sdwheeler and michaeltlombardi authored Aug 18, 2022
1 parent 964c3a6 commit e4dd62a
Show file tree
Hide file tree
Showing 11 changed files with 301 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/expectations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
name: Commenting
on:
schedule:
- cron: 0/10 * * * *
- cron: 0/30 * * * *
permissions:
contents: read
pull-requests: write
Expand Down
33 changes: 33 additions & 0 deletions .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Rule definitions live in .markdownlint.json

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

# Fix any fixable errors
fix: true

# Define a custom front matter pattern
# frontMatter: (^---\s*$[^]*?^---\s*$)(\r\n|\r|\n|$)

# Define glob expressions to use (only valid at root)
# globs:
# - "!*bout.md"

# Define glob expressions to ignore
ignores:
- breadcrumb

# Use a plugin to recognize math
# markdownItPlugins:
# - - "@iktakahiro/markdown-it-katex"

# Disable inline config comments
noInlineConfig: false

# Disable progress on stdout (only valid at root)
noProgress: true

# Use a specific formatter (only valid at root)
# outputFormatters:
# - [markdownlint-cli2-formatter-default]
132 changes: 132 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
{
"blanks-around-fences": true,
"blanks-around-headers": true,
"blanks-around-lists": true,
"code-block-style": {
"style": "fenced"
},
"code-fence-style": {
"style": "backtick"
},
"commands-show-output": true,
"docsmd.alert": true,
"docsmd.codesnippet": true,
"docsmd.column": true,
"docsmd.image": true,
"docsmd.moniker": true,
"docsmd.no-loc": true,
"docsmd.row": true,
"docsmd.securelinks": true,
"docsmd.syntax": true,
"docsmd.video": true,
"docsmd.xref": true,
"docsmd.zone": true,
"emphasis-style": {
"style": "underscore"
},
"fenced-code-language": false,
"first-line-h1": {
"front_matter_title": ""
},
"header-increment": true,
"header-start-left": true,
"header-style": {
"style": "atx"
},
"hr-style": {
"style": "---"
},
"line-length": {
"code_block_line_length": 90,
"code_blocks": true,
"heading_line_length": 100,
"headings": true,
"line_length": 100,
"stern": true,
"tables": false
},
"list-indent": true,
"list-marker-space": true,
"no-alt-text": true,
"no-bare-urls": true,
"no-blanks-blockquote": true,
"no-duplicate-header": {
"siblings_only": true
},
"no-emphasis-as-header": true,
"no-empty-links": true,
"no-hard-tabs": true,
"no-inline-html": {
"allowed_elements": [
"a",
"br",
"code",
"kbd",
"li",
"properties",
"sup",
"tags",
"ul"
]
},
"no-missing-space-atx": true,
"no-missing-space-closed-atx": true,
"no-multiple-blanks": true,
"no-multiple-space-atx": true,
"no-multiple-space-blockquote": true,
"no-multiple-space-closed-atx": true,
"no-reversed-links": true,
"no-space-in-code": true,
"no-space-in-emphasis": true,
"no-space-in-links": true,
"no-trailing-punctuation": {
"punctuation": ".,;:!。,;:!?"
},
"no-trailing-spaces": {
"br_spaces": 2,
"strict": true
},
"ol-prefix": {
"style": "one"
},
"proper-names": {
"code_blocks": false,
"names": [
"PowerShell",
"IntelliSense",
"Authenticode",
"CentOS",
"Contoso",
"CoreOS",
"Debian",
"Ubuntu",
"openSUSE",
"RHEL",
"JavaScript",
".NET",
"NuGet",
"VS Code",
"Newtonsoft"
]
},
"required-headers": false,
"single-h1": {
"front_matter_title": "",
"level": 1
},
"single-trailing-newline": true,
"strong-style": {
"style": "asterisk"
},
"ul-indent": {
"indent": 2,
"start_indented": false
},
"ul-start-left": true,
"ul-style": {
"style": "dash"
},
"link-fragments": true,
"reference-links-images": true,
"link-image-reference-definitions": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../../../../.markdownlint.json",
"no-emphasis-as-heading": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
description: Avoid using broken hash algorithms
ms.custom: PSSA v1.21.0
ms.date: 05/31/2022
ms.topic: reference
title: AvoidUsingBrokenHashAlgorithms
---
# AvoidUsingBrokenHashAlgorithms

**Severity Level: Warning**

## Description

Avoid using the broken algorithms MD5 or SHA-1.

## How

Replace broken algorithms with secure alternatives. MD5 and SHA-1 should be replaced with SHA256,
SHA384, SHA512, or other safer algorithms when possible, with MD5 and SHA-1 only being utilized by
necessity for backwards compatibility.

## Example 1

### Wrong

```powershell
Get-FileHash foo.txt -Algorithm MD5
```

### Correct

```powershell
Get-FileHash foo.txt -Algorithm SHA256
```

## Example 2

### Wrong

```powershell
Get-FileHash foo.txt -Algorithm SHA1
```

### Correct

```powershell
Get-FileHash foo.txt
```
1 change: 1 addition & 0 deletions reference/docs-conceptual/PSScriptAnalyzer/Rules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ The PSScriptAnalyzer contains the following rule definitions.
| [AvoidSemicolonsAsLineTerminators](./AvoidSemicolonsAsLineTerminators.md) | Warning | No | |
| [AvoidShouldContinueWithoutForce](./AvoidShouldContinueWithoutForce.md) | Warning | Yes | |
| [AvoidTrailingWhitespace](./AvoidTrailingWhitespace.md) | Warning | Yes | |
| [AvoidUsingBrokenHashAlgorithms](./AvoidUsingBrokenHashAlgorithms.md) | Warning | Yes | |
| [AvoidUsingCmdletAliases](./AvoidUsingCmdletAliases.md) | Warning | Yes | Yes<sup>2</sup> |
| [AvoidUsingComputerNameHardcoded](./AvoidUsingComputerNameHardcoded.md) | Error | Yes | |
| [AvoidUsingConvertToSecureStringWithPlainText](./AvoidUsingConvertToSecureStringWithPlainText.md) | Error | Yes | |
Expand Down
2 changes: 2 additions & 0 deletions reference/docs-conceptual/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ items:
href: PSScriptAnalyzer/Rules/AvoidShouldContinueWithoutForce.md
- name: AvoidTrailingWhitespace
href: PSScriptAnalyzer/Rules/AvoidTrailingWhitespace.md
- name: AvoidUsingBrokenHashAlgorithms
href: PSScriptAnalyzer/Rules/AvoidUsingBrokenHashAlgorithms.md
- name: AvoidUsingCmdletAliases
href: PSScriptAnalyzer/Rules/AvoidUsingCmdletAliases.md
- name: AvoidUsingComputerNameHardcoded
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../../../../.markdownlint.json",
"line-length": {
"code_block_line_length": 74,
"code_blocks": true,
"heading_line_length": 79,
"headings": true,
"line_length": 79,
"stern": true,
"tables": false
}
}
Loading

0 comments on commit e4dd62a

Please sign in to comment.