diff --git a/.github/styles/cloudflare/LatinTerms.yml b/.github/styles/cloudflare/LatinTerms.yml new file mode 100644 index 00000000000000..21d1ad90f44d2b --- /dev/null +++ b/.github/styles/cloudflare/LatinTerms.yml @@ -0,0 +1,18 @@ +--- +# Warning: cloudflare.LatinTerms +# +# Checks for use of Latin terms. +# Uses https://github.com/errata-ai/Google/blob/master/Google/Latin.yml for ideas. +# +# For a list of all options, see https://vale.sh/docs/topics/styles/ + +extends: substitution +message: "Use '%s' instead of '%s', but consider rewriting the sentence." +link: https://developers.cloudflare.com/style-guide/grammar/parts-of-speech/abbreviations/#ie-vs-eg +level: warning +nonword: true +ignorecase: true +swap: + '\b(?:e\.?g[\s.,;:])': for example + '\b(?:i\.?e[\s.,;:])': that is + '\bvia\b': "with', 'through', or 'by using" diff --git a/.github/styles/cloudflare/RelativeLinks.yml b/.github/styles/cloudflare/RelativeLinks.yml index 20a37d613e5c31..683d39bb40007a 100644 --- a/.github/styles/cloudflare/RelativeLinks.yml +++ b/.github/styles/cloudflare/RelativeLinks.yml @@ -5,8 +5,8 @@ # # For a list of all options, see https://vale.sh/docs/topics/styles/ extends: existence -message: "**Error**: When referring to another page in our docs, use the full relative link (`/1.1.1.1/check/`) instead of the full URL (`https://developers.cloudflare.com/1.1.1.1/check/`)." -level: error +message: "**Warning**: When referring to another page in our docs, use the full relative link (`/1.1.1.1/check/`) instead of the full URL (`https://developers.cloudflare.com/1.1.1.1/check/`)." +level: warning scope: raw raw: - '\[.+\]\(https?:\/\/developers\.cloudflare\.com\/.+\)' diff --git a/.github/styles/cloudflare/ShellCodeBlocks.yml b/.github/styles/cloudflare/ShellCodeBlocks.yml deleted file mode 100644 index 86a68884935740..00000000000000 --- a/.github/styles/cloudflare/ShellCodeBlocks.yml +++ /dev/null @@ -1,47 +0,0 @@ ---- -# Warning: cloudflare.ShellCodeBlocks -# -# Checks that all `sh` codeblocks contain at least one `$`, to indicate a command. -# -# For a list of all options, see https://vale.sh/docs/topics/styles/ -extends: script -message: "**Warning**: `sh` codeblocks must include a `$` character at the beginning of a command, otherwise it can't be copied. If this is a multi-line codeblock, please use the `bash` language. For more information, refer to [Code block guidelines](https://developers.cloudflare.com/style-guide/formatting/code-block-guidelines/)" -level: warning -scope: raw -script: | - text := import("text") - matches := [] - - open := false - closed := false - dollar := false - blockText := [] - - reset := func() { - open = false - closed = false - dollar = false - blockText = [] - } - - for line in text.split(scope, "\n") { - trimmed := text.trim_space(line) - - if !open && trimmed == "```sh" { open = true } - - if open { - blockText = append(blockText, line) - if !dollar && text.contains(trimmed, "$ ") { dollar = true } - if !closed && trimmed == "```" { closed = true } - } - - if open && closed { - if !dollar { - block := text.join(blockText, "\n") - start := text.index(scope, block) - matches = append(matches, { begin: start, end: start + len(block) }) - } - - reset() - } - } \ No newline at end of file diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml deleted file mode 100644 index 58eaeb05ec75df..00000000000000 --- a/.github/workflows/vale.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Style guide -on: - pull_request: - types: - - opened - - synchronize - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - review: - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Get Changed Files from Pull Request - if: ${{ !cancelled() }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - # get file names and structure as JSON - files=$(gh api /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files -q '.[] | select(.status != "removed") | .filename | select(test("(.yaml|yml|md)$"))') - filesArray="[$(echo "$files" | sed -e 's/^/"/' -e 's/$/"/' -e 's/ /", "/g' | tr '\n' , | sed 's/,$//')]" - echo "CHANGED_FILES=$filesArray" >> "$GITHUB_ENV" - - - name: Output Changed Files - run: echo ${{ env.CHANGED_FILES }} - - - name: Vale - uses: errata-ai/vale-action@reviewdog - if: ${{ !cancelled() }} - with: - files: ${{ env.CHANGED_FILES }} - reporter: github-pr-review - filter_mode: diff_context diff --git a/.vale.ini b/.vale.ini index 707c1420bf2335..dc974ee077dbda 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,12 +1,18 @@ StylesPath = .github/styles MinAlertLevel = suggestion +IgnoredScopes = code, tt, img, url, a +SkippedScopes = script, style, pre, figure, code [formats] yml = yaml +mdx = md + +[*] +# Ignore code surrounded by backticks or plus sign, parameters defaults, URLs, and angle brackets. +TokenIgnores = (<\/?[A-Z].+>), (\x60[^\n\x60]+\x60), ([^\n]+=[^\n]*), (\+[^\n]+\+), (http[^\n]+\[), (https[^\n]+\[) [*.md] BasedOnStyles = cloudflare -BlockIgnores = (?s) *({{< ?code-block [^>]* >}}.*?{{< ?/ ?code-block >}}) [*.yaml] BasedOnStyles = cloudflare \ No newline at end of file diff --git a/src/content/docs/rules/page-rules/index.mdx b/src/content/docs/rules/page-rules/index.mdx index 284c246f5b7e8a..517533fbfbdaff 100644 --- a/src/content/docs/rules/page-rules/index.mdx +++ b/src/content/docs/rules/page-rules/index.mdx @@ -4,10 +4,9 @@ source: https://support.cloudflare.com/hc/en-us/articles/218411427-What-do-the-c title: Page Rules sidebar: order: 10 - --- -import { FeatureTable } from "~/components" +import { FeatureTable } from "~/components"; Page rules trigger one or more actions whenever a certain URL pattern is matched. Page Rules are available in **Rules** > **Page Rules**. @@ -17,7 +16,7 @@ The default number of allowed page rules depends on the domain plan as shown bel -*** +--- ## Before getting started @@ -39,9 +38,9 @@ Cloudflare recommends only using reserved IP addresses or domain names to avoid For more information on reserved IP addresses or top level domains, please refer to these RFCs: -* [RFC 5737](https://datatracker.ietf.org/doc/html/rfc5737) -* [RFC 3849](https://datatracker.ietf.org/doc/html/rfc3849) -* [RFC 2606](https://datatracker.ietf.org/doc/html/rfc2606) +- [RFC 5737](https://datatracker.ietf.org/doc/html/rfc5737) +- [RFC 3849](https://datatracker.ietf.org/doc/html/rfc3849) +- [RFC 2606](https://datatracker.ietf.org/doc/html/rfc2606) ### Priority order matters @@ -67,6 +66,6 @@ The `` and `` segments are optional. If omitted, `` matche When a page rule is disabled, actions will not trigger, but the rule will: -* Still appear in the Cloudflare dashboard. -* Be editable. -* Count against the number of rules allowed for your domain. +- Still appear in the Cloudflare dashboard. +- Be editable. +- Count against the number of rules allowed for your domain.