From 3a94aa9f4bb798e86bd31de68bbe5513c0dd7ea0 Mon Sep 17 00:00:00 2001 From: Oliver Gould Date: Tue, 7 Jun 2022 11:25:18 -0700 Subject: [PATCH] dev: Use markdownlint-cli2 (#8612) VSCode extensions tend to use `markdownlint-cli2`. This change replaces our uses of `markdownlint-cli` with `markdownlint-cli2`. We update CI to use `DavidAnson/markdownlint-cli2-action` and we remove the `bin/markdown*` scripts. The devcontainer is updated to v16 including the appropriate set of tools. Signed-off-by: Oliver Gould --- .devcontainer/Dockerfile | 2 +- .devcontainer/devcontainer.json | 2 +- .github/workflows/markdown.yml | 23 +++++++++++++++++ .github/workflows/static_checks.yml | 10 -------- CHANGES.md | 6 ++--- bin/markdownlint | 20 --------------- bin/markdownlint-all | 8 ------ test/fuzzing/README.md | 39 ++++++++++++++++------------- 8 files changed, 50 insertions(+), 60 deletions(-) create mode 100644 .github/workflows/markdown.yml delete mode 100755 bin/markdownlint delete mode 100755 bin/markdownlint-all diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 2a9efddea..1636eeb82 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -86,7 +86,7 @@ RUN apt update && \ time \ unzip && \ rm -rf /var/lib/apt/lists/* -RUN npm install markdownlint-cli@0.23.1 --global +RUN npm install markdownlint-cli2@0.4.0 --global RUN sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen && locale-gen diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 34e889e07..05671dcdd 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,6 @@ { "name": "linkerd2", - "image": "ghcr.io/linkerd/dev:v15", + "image": "ghcr.io/linkerd/dev:v16", // "dockerFile": "./Dockerfile", // "context": "..", "extensions": [ diff --git a/.github/workflows/markdown.yml b/.github/workflows/markdown.yml new file mode 100644 index 000000000..44d26c092 --- /dev/null +++ b/.github/workflows/markdown.yml @@ -0,0 +1,23 @@ +name: markdown + +permissions: + contents: read + +on: + pull_request: + paths: + - '**/*.md' + - .github/workflows/markdown.yml + +jobs: + markdownlint: + timeout-minutes: 5 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b + - uses: DavidAnson/markdownlint-cli2-action@744f913a124058ee903768d3adb92a4847e5d132 + with: + globs: | + **/*.md + !**/node_modules/** + !target/** diff --git a/.github/workflows/static_checks.yml b/.github/workflows/static_checks.yml index 1a8667ebc..32482ab43 100644 --- a/.github/workflows/static_checks.yml +++ b/.github/workflows/static_checks.yml @@ -76,16 +76,6 @@ jobs: rootPath: bin/win/tools failOnInfos: true - markdown_lint: - name: Markdown lint - timeout-minutes: 10 - runs-on: ubuntu-20.04 - steps: - - name: Checkout code - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b - - name: Markdown lint - run: bin/markdownlint-all - chart_docs_diff: name: Chart readme diff check runs-on: ubuntu-20.04 diff --git a/CHANGES.md b/CHANGES.md index 316bbcbdf..00cea4974 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2572,7 +2572,7 @@ transparent to the application, and work with any network topology. attempts to prevent the most common traffic-loop scenarios to protect against this. -***NOTE***: Linkerd's `multicluster` extension does not yet work on Amazon +_**NOTE**_: Linkerd's `multicluster` extension does not yet work on Amazon EKS. We expect to follow this release with a stable-2.8.1 to address this issue. Follow [#4582](https://github.com/linkerd/linkerd2/pull/4582) for updates. @@ -5508,8 +5508,8 @@ to reduce possible naming collisions. To upgrade an existing installation: For more information, see the [Upgrade Guide](https://linkerd.io/2/upgrade/). * CLI - * **Improved** `linkerd routes` command displays per-route stats for *any - resource*! + * **Improved** `linkerd routes` command displays per-route stats for _any + resource_! * **New** Service profiles are now supported for external authorities! * **New** `linkerd routes --open-api` flag generates a service profile based on an OpenAPI specification (swagger) file diff --git a/bin/markdownlint b/bin/markdownlint deleted file mode 100755 index 039a4d39c..000000000 --- a/bin/markdownlint +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env sh - -set -eu - -bindir=$( cd "${0%/*}" && pwd ) -rootdir=$( cd "$bindir"/.. && pwd ) - -version=0.23.1 - -export PATH="$rootdir/node_modules/.bin:$PATH" - -if ! command -v markdownlint >/dev/null || [ "$(markdownlint -V)" != "$version" ]; then - if ! [ -x "$(command -v npm)" ]; then - echo 'Error: npm required to install markdownlint command' >&2 - exit 1 - fi - npm install "markdownlint-cli@$version" -fi - -markdownlint "$@" diff --git a/bin/markdownlint-all b/bin/markdownlint-all deleted file mode 100755 index f50b55b1e..000000000 --- a/bin/markdownlint-all +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env sh - -set -eu - -bindir=$( cd "${0%/*}" && pwd ) - -"$bindir"/markdownlint ./*.md -"$bindir"/markdownlint ./**/*.md --ignore node_modules/ diff --git a/test/fuzzing/README.md b/test/fuzzing/README.md index c1a9f67aa..e000435c3 100644 --- a/test/fuzzing/README.md +++ b/test/fuzzing/README.md @@ -1,26 +1,31 @@ # Fuzzing Linkerd -The scripting setup for fuzzing is used by -[google/oss-fuzz](https://github.com/google/oss-fuzz) which performs continuous -fuzzing for the Linkerd project. +The scripting setup for fuzzing is used by [google/oss-fuzz] which +performs continuous fuzzing for the Linkerd project. -The fuzzing configuration for Linkerd is located in the -[linkerd2](https://github.com/google/oss-fuzz/tree/master/projects/linkerd2) -project which handles the docker build and execution of the fuzzers. +The fuzzing configuration for Linkerd is located in the [linkerd2 +project directory][of-l2] which handles the docker build and execution of the +fuzzers. ## Running locally -Instructions for running the fuzzers locally can be found in the oss-fuzz -[docs](https://google.github.io/oss-fuzz/getting-started/new-project-guide/#testing-locally). -This will require cloning the [oss-fuzz](https://github.com/google/oss-fuzz) -repository locally and running the commands outlined in the instructions. +Instructions for running the fuzzers locally can be found in the oss-fuzz +[docs]. + +This will require cloning the [google/oss-fuzz] repository locally and running +the commands outlined in the instructions. ### oss-fuzz File Setup -- [Dockerfile](https://github.com/google/oss-fuzz/blob/master/projects/linkerd2/Dockerfile) - provides the necessary environment for running the fuzzer; the main thing - being the `oss-fuzz-base` image which provides the `compile_go_fuzzer` - funtions seen in this directory's `build.sh`. -- [build.sh](https://github.com/google/oss-fuzz/blob/master/projects/linkerd2/build.sh) - is responsible for calling the fuzzing functions for each fuzzer in the - linkerd2 project. +- [Dockerfile] provides the necessary environment for running the + fuzzer; the main thing being the `oss-fuzz-base` image which provides the + `compile_go_fuzzer` funtions seen in this directory's `build.sh`. +- [build.sh] is responsible for calling the fuzzing functions for each + fuzzer in the linkerd2 project. + + +[google/oss-fuzz]: https://github.com/google/oss-fuzz +[of-l2]: https://github.com/google/oss-fuzz/tree/master/projects/linkerd2 +[docs]: https://google.github.io/oss-fuzz/getting-started/new-project-guide/#testing-locally +[Dockerfile]: https://github.com/google/oss-fuzz/blob/master/projects/linkerd2/Dockerfile +[build.sh]: https://github.com/google/oss-fuzz/blob/master/projects/linkerd2/build.sh