-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: detect crossover links as a PR check (#2675)
* feat: define crossover link validation rules and enable them with vale * feat: run vale as a pull request check * feat: add a linting rule for production links * fix: swap order of prettier and vale, so that both of them run on every change * oops: remove prettier changes frmo this PR * docs: add descriptions to each of the vale rules
- Loading branch information
1 parent
0958fb2
commit b6edc91
Showing
7 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: check-format | ||
on: [pull_request] | ||
|
||
jobs: | ||
check-format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 16 | ||
- name: Install Dependencies | ||
run: npm ci | ||
- name: Verify format with Vale | ||
uses: errata-ai/vale-action@reviewdog | ||
with: | ||
filter_mode: added | ||
reporter: github-pr-review |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
StylesPath = "styles/camunda" | ||
|
||
[{docs,versioned_docs}/**/*.{md,mdx}] | ||
BasedOnStyles = all, docsInstance | ||
|
||
[{optimize,optimize_versioned_docs}/**/*.{md,mdx}] | ||
BasedOnStyles = all, optimizeInstance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
extends: existence | ||
message: "Improper link format: '%s'. Please use relative URLs." | ||
level: warning | ||
nonword: true | ||
scope: raw | ||
tokens: | ||
# Captures anything that is hardcoded to our production URL. | ||
- "\\[[^\\]]*\\]\\(https://docs.camunda.io/(optimize|docs)/[^\\)]*\\)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
extends: existence | ||
message: "Improper link format: '%s'. Please specify the file extension." | ||
level: warning | ||
nonword: true | ||
scope: raw | ||
tokens: | ||
# Captures any markdown link that directs to a URL starting with `docs` and not ending with `.md` or `.mdx`. | ||
- "\\[[^\\]]*\\]\\((\\.)?(\\/)?docs(?!.*(\\.md|\\.mdx))[^\\)]*\\)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
extends: existence | ||
message: "Improper link format: '%s'. Please use the `$optimize$` token when crossing doc instances." | ||
level: warning | ||
nonword: true | ||
scope: raw | ||
tokens: | ||
# Captures any markdown link that crosses over to the `optimize` instance without using `$optimize$`. | ||
- "\\[[^\\]]*\\]\\(\\/optimize[^\\)]*\\)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
extends: existence | ||
message: "Improper link format: '%s'. Please use the `$docs$` token when crossing doc instances." | ||
level: warning | ||
nonword: true | ||
scope: raw | ||
tokens: | ||
# Captures any markdown link that crosses over to the `docs` instance without using `$docs$`. | ||
- "\\[[^\\]]*\\]\\(\\/docs[^\\)]*\\)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
extends: existence | ||
message: "Improper link format: '%s'. Please specify the file extension." | ||
level: warning | ||
nonword: true | ||
scope: raw | ||
tokens: | ||
# Captures any markdown link that directs to a URL starting with `optimize` and not ending with `.md` or `.mdx`. | ||
- "\\[[^\\]]*\\]\\((\\.)?(\\/)?optimize(?!.*(\\.md|\\.mdx))[^\\)]*\\)" |