From 1b52349c5b8ef3610ddee64d9adb36177ead0114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Thu, 22 Dec 2022 11:38:23 +0100 Subject: [PATCH] Use markdownlint GitHub action (#1507) --- .../markdownlint-problem-matcher.json | 17 +++++++++++ .github/workflows/markdownlint.yml | 29 +++++++++++++++++++ .markdownlint.json | 3 ++ CONTRIBUTING.md | 2 +- azure-pipelines.yml | 16 +++------- ...ramework-Extensibility-Trait-Attributes.md | 4 +-- ...amework-Extensibility-Custom-Assertions.md | 2 +- 7 files changed, 57 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/markdownlint-problem-matcher.json create mode 100644 .github/workflows/markdownlint.yml diff --git a/.github/workflows/markdownlint-problem-matcher.json b/.github/workflows/markdownlint-problem-matcher.json new file mode 100644 index 000000000..712ff4a99 --- /dev/null +++ b/.github/workflows/markdownlint-problem-matcher.json @@ -0,0 +1,17 @@ +{ + "problemMatcher": [ + { + "owner": "markdownlint", + "pattern": [ + { + "regexp": "^([^:]*):(\\d+):?(\\d+)?\\s([\\w-\\/]*)\\s(.*)$", + "file": 1, + "line": 2, + "column": 3, + "code": 4, + "message": 5 + } + ] + } + ] +} \ No newline at end of file diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml new file mode 100644 index 000000000..91eb19ad4 --- /dev/null +++ b/.github/workflows/markdownlint.yml @@ -0,0 +1,29 @@ +name: Markdownlint + +permissions: + contents: read + +on: + pull_request: + paths: + - "**/*.md" + - ".markdownlint.json" + - ".github/workflows/markdownlint.yml" + - ".github/workflows/markdownlint-problem-matcher.json" + +jobs: + lint: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: 16.x + - name: Run Markdownlint + run: | + echo "::add-matcher::.github/workflows/markdownlint-problem-matcher.json" + npm i -g markdownlint-cli + markdownlint "**/*.md" \ No newline at end of file diff --git a/.markdownlint.json b/.markdownlint.json index d094b28bf..fc76b923e 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -1,5 +1,8 @@ { "default": true, + "MD009": { + "br_spaces": 0 + }, "MD013": false, "MD046": { "style": "fenced" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1045ae763..deb035e73 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -28,5 +28,5 @@ There are many ways to contribute: ## Coding Style The MSTest project follows the same rules as runtime repository [developer guide](https://github.com/dotnet/runtime/blob/main/docs/coding-guidelines/coding-style.md). -The repository includes [.editorconfig](http://editorconfig.org) files to help enforce this convention. +The repository includes [.editorconfig](http://editorconfig.org) files to help enforce this convention. Contributors should ensure they follow these guidelines when making submissions. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ab819dc13..090857784 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -14,8 +14,10 @@ pr: exclude: - .github/* - .devcontainer/* - - CODE-OF-CONDUCT.md - - LICENSE + - docs/* + - CODE_OF_CONDUCT.md + - CONTRIBUTING.md + - README.md - SECURITY.md parameters: @@ -234,13 +236,3 @@ stages: SkipLocProjectJsonGeneration: true GitHubOrg: microsoft MirrorRepo: testfx - - - ${{ if eq(variables._RunAsPublic, True) }}: - - job: Markdownlint - pool: - vmImage: ubuntu-22.04 - steps: - - script: sudo npm install -g markdownlint-cli@0.32.2 - displayName: Install markdownlint-cli - - script: markdownlint '**/*.md' - displayName: Run markdownlint diff --git a/docs/RFCs/001-Framework-Extensibility-Trait-Attributes.md b/docs/RFCs/001-Framework-Extensibility-Trait-Attributes.md index 7eb3fd355..f23efacb3 100644 --- a/docs/RFCs/001-Framework-Extensibility-Trait-Attributes.md +++ b/docs/RFCs/001-Framework-Extensibility-Trait-Attributes.md @@ -7,7 +7,7 @@ ## Summary -This details the MSTest V2 framework extensibility for attributes that are traits for a test. +This details the MSTest V2 framework extensibility for attributes that are traits for a test. ## Motivation @@ -94,7 +94,7 @@ Users can then filter tests in VS IDE Test Explorer based on this Test Property. Trait:"CustomTraitProperty" Trait:"234" ``` -This would provide extension writers with the same level of functionality that TestProperty already has with filtering and reporting plus the added ease of having a strongly typed trait. +This would provide extension writers with the same level of functionality that TestProperty already has with filtering and reporting plus the added ease of having a strongly typed trait. ### Requirements from Test Platform diff --git a/docs/RFCs/002-Framework-Extensibility-Custom-Assertions.md b/docs/RFCs/002-Framework-Extensibility-Custom-Assertions.md index 4fde55d1f..319c304da 100644 --- a/docs/RFCs/002-Framework-Extensibility-Custom-Assertions.md +++ b/docs/RFCs/002-Framework-Extensibility-Custom-Assertions.md @@ -7,7 +7,7 @@ ## Summary -This details the MSTest V2 framework extensibility for extending the Assert class to add custom assertions. +This details the MSTest V2 framework extensibility for extending the Assert class to add custom assertions. ## Motivation