|
| 1 | +# yaml-language-server: $schema=https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json |
| 2 | +# docs: https://cspell.org/docs/getting-started |
| 3 | +# ------------------------------------------------------------------------------ |
| 4 | +# This file is synced from the radius-project/.github repository. |
| 5 | +# DO NOT EDIT MANUALLY - changes will be overwritten by the next sync. |
| 6 | +# Source: https://github.com/radius-project/.github |
| 7 | +# ------------------------------------------------------------------------------ |
| 8 | +--- |
| 9 | +$schema: https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json |
| 10 | +version: "0.2" |
| 11 | +language: en |
| 12 | + |
| 13 | +# Built-in dictionaries plus the shared custom word list (.cspellignore at repo root). |
| 14 | +# This is the unified Radius spell-checking configuration; per-repository custom |
| 15 | +# words belong in the repo's own .cspellignore file, not in this synced config. |
| 16 | +dictionaries: |
| 17 | + - softwareTerms |
| 18 | + - companies |
| 19 | + - python |
| 20 | + - bash |
| 21 | + - filetypes |
| 22 | + - en_US |
| 23 | + - cspellignore |
| 24 | + |
| 25 | +# Ignore patterns within files (sections that should not be spell-checked). |
| 26 | +ignoreRegExpList: |
| 27 | + - code_block |
| 28 | + - adr_yaml_formatter |
| 29 | + - inline_code |
| 30 | + - tf_docs |
| 31 | + - md_link |
| 32 | + - url |
| 33 | + - at_mention |
| 34 | + - html_tag |
| 35 | + - email_address |
| 36 | + - hugo_shortcode |
| 37 | + - front_matter |
| 38 | + - html_code_tag |
| 39 | + |
| 40 | +# Custom regex patterns so that fenced code, inline code, markdown links, URLs, |
| 41 | +# HTML and similar tokens are excluded from spell-checking. |
| 42 | +patterns: |
| 43 | + # Fenced code blocks: ```lang ... ``` (with or without language identifier). |
| 44 | + # Allows leading whitespace so indented code blocks inside list items match. |
| 45 | + - name: code_block |
| 46 | + pattern: |
| 47 | + - /^[ \t]*`{3,}[^\n]*\n[\s\S]*?^[ \t]*`{3,}\s*$/gm |
| 48 | + - name: adr_yaml_formatter |
| 49 | + pattern: |
| 50 | + - /(^([a-z-]*[:]{1})((\w|\s|,|"|-)*?)$)/gm |
| 51 | + # Inline code: `some code here` |
| 52 | + - name: inline_code |
| 53 | + pattern: |
| 54 | + - /`[^`\r\n]*`/g |
| 55 | + - name: tf_docs |
| 56 | + pattern: |
| 57 | + - ^(?:\s*\|{1}\s*)(?:<a name="(?:requirement|provider|module){1}_[\w]*"></a>){1} |
| 58 | + - \[.*\]\(#(?:requirement|provider|module){1}.*\)\s* |
| 59 | + - \|{1}\s*\[[\w_\.]*\]\(.*\)\s*\|\s(?:resource|data source)\s*\| |
| 60 | + - (?:\|\s*){1}(?:Azure\/avm){1}.*(?:\s*\|){1} |
| 61 | + # Markdown link / image targets: only the `](url)` portion is ignored so |
| 62 | + # typos in the visible link text or image alt text are still caught. |
| 63 | + # Matches both `[text](url)` and `` because we only skip the |
| 64 | + # parentheses payload. |
| 65 | + - name: md_link |
| 66 | + pattern: |
| 67 | + - /\]\([^)]*\)/g |
| 68 | + # URLs |
| 69 | + - name: url |
| 70 | + pattern: |
| 71 | + - /https?:\/\/[^\s)>]*/g |
| 72 | + # @mentions like @user or @team-name |
| 73 | + - name: at_mention |
| 74 | + pattern: |
| 75 | + - /(?<!\w)@[\w.-]+/g |
| 76 | + # HTML tags |
| 77 | + - name: html_tag |
| 78 | + pattern: |
| 79 | + - /<[^>]+>/g |
| 80 | + # Content between HTML <code>...</code> tags (used in tables that can't use markdown code fences) |
| 81 | + - name: html_code_tag |
| 82 | + pattern: |
| 83 | + - /<code>[\s\S]*?<\/code>/g |
| 84 | + # Email addresses |
| 85 | + - name: email_address |
| 86 | + pattern: |
| 87 | + - /[\w.+-]+@[\w.-]+\.[a-zA-Z]{2,}/g |
| 88 | + # Hugo / Docsy shortcodes: {{< rad file="..." >}} or {{% notice %}} |
| 89 | + - name: hugo_shortcode |
| 90 | + pattern: |
| 91 | + - /\{\{[%<][\s\S]*?[%>]\}\}/g |
| 92 | + # Hugo front matter: only skip non-rendered keys so user-facing fields |
| 93 | + # (title, description, linkTitle) are still spell-checked. The first |
| 94 | + # sub-pattern covers single-line `key: value` entries; the second covers |
| 95 | + # multi-line list values (e.g. `aliases:` followed by indented `- /path` |
| 96 | + # items); the third matches the `---` / `+++` delimiter lines. |
| 97 | + - name: front_matter |
| 98 | + pattern: |
| 99 | + - /^(?:type|weight|slug|url|no_list|manualLink|manualLinkTarget|category|categories|tags)\s*:[^\n]*$/gm |
| 100 | + - /^aliases\s*:[^\n]*(?:\n[ \t]+-[^\n]*)*/gm |
| 101 | + - /^(?:---|\+\+\+)\s*$/gm |
| 102 | + |
| 103 | +# Use the shared .cspellignore file (at the repo root) as a custom dictionary. |
| 104 | +dictionaryDefinitions: |
| 105 | + - name: cspellignore |
| 106 | + path: ../../.cspellignore |
| 107 | + addWords: true |
| 108 | + |
| 109 | +# Allow compound words to be checked as a single word |
| 110 | +# (e.g., "spellcheck" instead of "spell check"). |
| 111 | +allowCompoundWords: true |
| 112 | + |
| 113 | +# Paths that should not be spell-checked: vendored theme/modules, generated |
| 114 | +# Hugo output, dependency folders and the shared dictionary itself. |
| 115 | +# Patterns use the `**/` prefix because cspell resolves ignorePaths relative |
| 116 | +# to the config file location (.github/linters/). Entries that do not exist in |
| 117 | +# a given repository are simply no-ops, so this superset is safe to share. |
| 118 | +ignorePaths: |
| 119 | + - "**/node_modules/**" |
| 120 | + - "**/.dev/**" |
| 121 | + - "**/.venv/**" |
| 122 | + - "**/venv/**" |
| 123 | + - "**/.terraform/**" |
| 124 | + - "**/.cspellignore" |
| 125 | + - "**/themes/**" |
| 126 | + - "**/_vendor/**" |
| 127 | + - "**/public/**" |
| 128 | + - "**/resources/_gen/**" |
| 129 | + - "**/holding-pen/**" |
| 130 | + - "**/redirect/**" |
| 131 | + - "**/presentation-pack/**" |
| 132 | + |
| 133 | +# Default to checking both Markdown and YAML. CI also passes an explicit glob. |
| 134 | +files: |
| 135 | + - "**/*.{md,yaml,yml}" |
0 commit comments