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 <ver@buoyant.io>
This commit is contained in:
Oliver Gould 2022-06-07 11:25:18 -07:00 committed by GitHub
parent 4fa4482087
commit 3a94aa9f4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 50 additions and 60 deletions

View File

@ -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

View File

@ -1,6 +1,6 @@
{
"name": "linkerd2",
"image": "ghcr.io/linkerd/dev:v15",
"image": "ghcr.io/linkerd/dev:v16",
// "dockerFile": "./Dockerfile",
// "context": "..",
"extensions": [

23
.github/workflows/markdown.yml vendored Normal file
View File

@ -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/**

View File

@ -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

View File

@ -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

View File

@ -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 "$@"

View File

@ -1,8 +0,0 @@
#!/usr/bin/env sh
set -eu
bindir=$( cd "${0%/*}" && pwd )
"$bindir"/markdownlint ./*.md
"$bindir"/markdownlint ./**/*.md --ignore node_modules/

View File

@ -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.
<!-- refs -->
[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