-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
As of Vale 3.8.0, it is possible to set custom comment delimiters so an author can temporarily disable a style rule within an MDX docs page. For example, an author can ignore the `protocol-products` rule by including this: ```text {/* vale messaging.protocol-products = NO */} This paragraph is about server access. {/* vale messaging.protocol-products = YES */} ``` As a result, we can require the Vale prose linter without worrying about false positives. This change updates the version of Vale used by the linting job to 3.8.0. It also makes the prose linting step part of the required Lint (Docs) job. To do so, it overrides `yarn git-update` to ignore submodules, checks out `gravitational/teleport` at the current branch, and copies the `teleport` clone into the directory where the docs engine expects submodules. It then edits the working directory of the Vale job. Since the Vale job only ran on `pull_request` events, and not `merge_group`, this change also adjusts all of `Lint (Docs)` to run on `pull_request`. Finally, this change edits the level of some Vale styles: - `error` (which causes Vale to exit with a nonzero status code): styles where we want to ensure consistency/correctness, and where it is possible to disable the style using comments. - `warning` (which causes Vale to print a message but exit with a zero status code): style rules that an author might need to ignore. This includes style rules with the `raw` scope, which cannot be disabled using comments.
- Loading branch information
Showing
8 changed files
with
39 additions
and
62 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
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 |
---|---|---|
|
@@ -6,3 +6,4 @@ mdx = md | |
|
||
[*.md] | ||
BasedOnStyles = messaging,examples,3rd-party-products,structure | ||
CommentDelimiters = "{/*,*/}" |
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
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
extends: substitution | ||
message: "Incorrect example of a Teleport account URL. Use %s instead of %s." | ||
level: error | ||
scope: raw # So we can catch instances in code fences | ||
level: warning | ||
scope: | ||
- raw | ||
ignorecase: true | ||
swap: | ||
- 'https://(?!status|example)\w+.teleport\.sh': 'example.teleport.sh (or status.teleport.sh for the status page)' |
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 |
---|---|---|
@@ -1,13 +1,8 @@ | ||
extends: existence | ||
scope: | ||
# Using the raw scope so we can catch instances in TabItem labels. | ||
- raw | ||
message: '"%s" is no longer a recognized Teleport edition. Use "Teleport Enterprise (Self-Hosted)" or "Teleport Enterprise (Cloud)" instead. If the hosting type is not important in a given sentence, there is no need to specify it, and you can use "Teleport Enterprise".' | ||
level: error | ||
ignorecase: false | ||
ignorecase: true | ||
tokens: | ||
# Adding the pattern '[ \t]*\n?[ \t]*' between each word since we are using the raw | ||
# scope. This lets use catch violations that span two lines (i.e., that occupy | ||
# the same paragraph). | ||
- 'Teleport[ \t]*\n?[ \t]*Cloud' | ||
- 'Teleport[ \t]*\n?[ \t]*Enterprise[ \t]*\n?[ \t]*Cloud' | ||
- 'Teleport Cloud' | ||
- 'Teleport Enterprise Cloud' |
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
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
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