Victor Morales | 9e8d268 | 2021-09-14 09:34:55 -0700 | [diff] [blame] | 1 | # Copyright (c) 2020-2021 Project CHIP Authors |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
Andrei Litvin | a76f75e | 2022-04-13 08:34:42 -1000 | [diff] [blame] | 15 | # To run locally: |
| 16 | # Prerequisits (only once): |
| 17 | # |
| 18 | # apt-get install aspell aspell-en |
| 19 | # pip install pyspelling |
| 20 | # |
| 21 | # Actual run: |
| 22 | # |
| 23 | # pyspelling pyspelling --config .spellcheck.yml |
| 24 | |
Victor Morales | 9e8d268 | 2021-09-14 09:34:55 -0700 | [diff] [blame] | 25 | matrix: |
| 26 | - name: markdown |
| 27 | dictionary: |
| 28 | wordlists: |
| 29 | - .github/.wordlist.txt |
| 30 | pipeline: |
Andrei Litvin | a76f75e | 2022-04-13 08:34:42 -1000 | [diff] [blame] | 31 | # See https://facelessuser.github.io/pyspelling/configuration/#pipeline |
| 32 | # and https://facelessuser.github.io/pyspelling/filters/context/ |
| 33 | |
| 34 | # context-aware logic: we have a LOT of code examples in markdown, |
| 35 | # avoid trying to spellcheck code. |
| 36 | - pyspelling.filters.context: |
| 37 | context_visible_first: true |
| 38 | escapes: \\[\\`~] |
| 39 | delimiters: |
| 40 | # Ignore multiline content between fences (fences can have 3 or more back ticks) |
| 41 | # ``` |
| 42 | # content |
| 43 | # ``` |
| 44 | # |
| 45 | # Allows language marker (since github allows it) like: |
| 46 | # ```python |
| 47 | # content |
| 48 | # ``` |
| 49 | - open: '(?s)^(?P<open> *`{3,})[a-z]*$' |
| 50 | close: '^(?P=open)$' |
| 51 | # Ignore text between inline back ticks |
| 52 | - open: '(?P<open>`+)' |
| 53 | close: '(?P=open)' |
| 54 | # Ignore URL in hyperlinks [title](url) |
| 55 | - open: '\[[^]]*\]\(' |
| 56 | close: '\)' |
| 57 | # Ignore code markers |
| 58 | - open: '<code>' |
| 59 | close: '</code>' |
| 60 | |
| 61 | # converts markdown to HTML |
Victor Morales | 9e8d268 | 2021-09-14 09:34:55 -0700 | [diff] [blame] | 62 | - pyspelling.filters.markdown: |
| 63 | sources: |
| 64 | - '**/*.md|!third_party/**|!examples/common/**/repo/**' |
| 65 | aspell: |
| 66 | ignore-case: true |