Skip to content

Commit 2aa10eb

Browse files
committed
ADD TO: basic QA / add spellcheck / WIP
1 parent 88a0b0b commit 2aa10eb

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed

.cspell.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
$schema: https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json
2+
version: '0.2'
3+
language: en-GB
4+
readonly: true
5+
6+
useGitignore: true
7+
8+
dictionaries:
9+
- php
10+
11+
patterns:
12+
- name: markdown_code_block
13+
pattern: |
14+
/
15+
^(\s*`{3,})[a-z]+ # match the ``` with a language modifier
16+
[\s\S]*? # the block of code
17+
^\1 # end of the block
18+
/gmx
19+
- name: markdown_inline_code
20+
pattern: /(\s*`)[^`\n]{3,}`/gmx
21+
22+
languageSettings:
23+
- languageId: markdown
24+
ignoreRegExpList:
25+
- markdown_code_block
26+
- markdown_inline_code
27+
28+
words:
29+
# Generic "good" words.
30+
- PHP_CodeSniffer
31+
- phpcs
32+
- phpcbf
33+
- Allman
34+
- Analyzer
35+
- anymore
36+
- csslint
37+
- docblocks
38+
- gitblame
39+
- Joomla
40+
- nowdocs
41+
- Squiz
42+
- SquizLabs
43+
44+
# Used in "gitblame" report.
45+
- jsmith
46+
- jblogs
47+
- pdeveloper
48+
- jscript
49+
- toogood

.github/workflows/basic-qa.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,34 @@ jobs:
4646
format: markdown
4747
token: ${{ secrets.GITHUB_TOKEN }}
4848
fail: true
49+
50+
spellcheck:
51+
name: Spellcheck
52+
# Config file: .cspell.yml
53+
54+
runs-on: ubuntu-latest
55+
56+
steps:
57+
- name: Checkout code
58+
uses: actions/checkout@v4
59+
60+
- name: Spellcheck
61+
id: spellcheck
62+
uses: streetsidesoftware/cspell-action@v7
63+
with:
64+
# Define glob patterns to filter the files to be checked. Use a new line between patterns to define multiple patterns.
65+
files: '**/*.md'
66+
root: '.'
67+
suggestions: true
68+
# Notification level for annotations. Allowed values are: warning, error, none
69+
inline: warning
70+
treat_flagged_words_as_errors: true
71+
# Determines if the action should be failed if any spelling issues are found.
72+
strict: false
73+
# Limit the files checked to the ones in the pull request or push.
74+
incremental_files_only: false
75+
76+
- name: Fail the build when more spelling issues were found than expected
77+
# yamllint disable-line rule:line-length
78+
if: ${{ steps.spellcheck.outputs.success == false && steps.spellcheck.outputs.number_of_issues != 11 && steps.spellcheck.outputs.number_of_files_with_issues != 5}}
79+
run: exit 1

0 commit comments

Comments
 (0)