-
Notifications
You must be signed in to change notification settings - Fork 49
Adding opt-in common test for spellchecking markdown files #279
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #279 +/- ##
===================================
Coverage 73% 73%
===================================
Files 12 12
Lines 1543 1543
Branches 2 2
===================================
Hits 1129 1129
Misses 412 412
Partials 2 2 |
Tested OK here: |
This problem has been reported here: streetsidesoftware/cspell#61 It is using this cSpell configuration file ( {
"ignorePaths": [
".git/*",
".vscode/*",
"DSCResource.Tests/*",
"DscResource.Tests/*"
],
"language": "en",
"dictionaries": [
"powershell"
],
"words": [
"FIPS",
"MSFT",
"HQRM",
"markdownlint",
"Chocolatey",
"codecov"
],
"ignoreRegExpList": [
"\\.gitignore",
"\\.gitattributes",
"AppVeyor",
"[email protected]"
]
} The key The key This configuration file, and how it can be used by the test and VS Code should be documented before merge. |
Tested OK: |
2a02339
to
fa6cc37
Compare
cdb92b6
to
307ed32
Compare
Need help review this PR. I anyone wants to review this PR, or any other PR, you are more than welcome! Love to have more people helping out with reviews! |
d4cc5ff
to
65d9eb0
Compare
I will rebase once the other two PR's are through, because they made changes in sections in markdown that was moved in this PR. But anyone, please start the review anyway. |
- Adding opt-in common test for spellchecking markdown files. Opt-in by adding "Common Tests - Spellcheck Markdown Files" in the file .MetaTestOptIn.json (issue PowerShell#211).
…dded the settings file `.vscode\cSpell.json`.
- Move section Phased Meta test Opt-In in the README.md, and renamed it to Common Meta test Opt-In (issue PowerShell#281).
65d9eb0
to
279a477
Compare
Cool. Let me know when and I'll review. |
@PlagueHO It's ready now - the tests should pass in a few minutes. Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 4 of 4 files at r1.
Reviewable status: all files reviewed, 8 unresolved discussions (waiting on @johlju)
Meta.Tests.ps1, line 1085 at r1 (raw file):
It 'Should not have spelling errors in any markdown files' -Skip:(!$optIn) { $spellcheckSettingsFilePath = Join-Path -Path $repoRootPath -ChildPath '.vscode\cSpell.json' if (Test-Path -Path $spellcheckSettingsFilePath)
Can add a blank line above here?
Meta.Tests.ps1, line 1150 at r1 (raw file):
if (Test-Path $errorFileName) { Remove-Item -Path $errorFileName -Force
FYI, Could assign to $null so that we don't end up outputting result to output stream.
README.md, line 123 at r1 (raw file):
#### Common Tests - Spellcheck Markdown Files When opt-in for this test, if there are any spelling errors in markdown files,
When opt-in for -> When opt-in to
README.md, line 127 at r1 (raw file):
>**Note:** The spell checker is case-insensitive, so the words 'AppVeyor' and >'appveyor' is equal and both allowed.
is equal and both allowed. -> are equal and both are allowed.
README.md, line 130 at r1 (raw file):
If the spell checker ([cSpell](https://www.npmjs.com/package/cspell)) does not recognize the word, but the word are correct, or maybe there are a specific phrase
Might read better as:
If the spell checker ([cSpell](https://www.npmjs.com/package/cspell)) does not
recognize the word, but the word is correct or a specific phrase is not recognized
but should be allowed, then it is possible to add these to a dictionary or tell it to
ignore the word of phrases. This is done by adding a `\.vscode\cSpell.json` in
the repository.
README.md, line 134 at r1 (raw file):
tell it to ignore words or phrases. By adding a file `\.vscode\cSpell.json` in the repository, the spell checker
This line could be removed if using the text above.
README.md, line 137 at r1 (raw file):
will follow the settings in this file. The simplest form of the file `\.vscode\cSpell.json` is this (see
The following JSON is the simplest form of the file \.vscode\cSpell.json
(see cSpell for more settings).
README.md, line 174 at r1 (raw file):
The key `ignoreRegExpList` is better to use to ignore phrases or combination of
The key ignoreRegExpList
is used to ignore phrases or combinations of words, such as AppVeyor
, which will be detected as two different words since it consists of two words starting with upper-case letters.
README.md, line 177 at r1 (raw file):
words, like 'AppVeyor', it will detect that word as two different words, since it consist of two words with upper-case letter. So for it to ignore 'AppVeyor', as we know it's correct, we can add a regular
To configure cSpell to ignore AppVeyor
, then we can add a regular expression, in this case AppVeyor
. This will cause cSpell to ignore part of the text that matches the regular expression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 2 of 4 files reviewed, 8 unresolved discussions (waiting on @PlagueHO)
Meta.Tests.ps1, line 1085 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
Can add a blank line above here?
Done.
README.md, line 123 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
When opt-in for -> When opt-in to
Done.
README.md, line 127 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
is equal and both allowed. -> are equal and both are allowed.
Done.
README.md, line 130 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
Might read better as:
If the spell checker ([cSpell](https://www.npmjs.com/package/cspell)) does not recognize the word, but the word is correct or a specific phrase is not recognized but should be allowed, then it is possible to add these to a dictionary or tell it to ignore the word of phrases. This is done by adding a `\.vscode\cSpell.json` in the repository.
Done. Thank you for the updated text in the review comments! Much better now! 😄
README.md, line 134 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
This line could be removed if using the text above.
Done.
README.md, line 137 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
The following JSON is the simplest form of the file
\.vscode\cSpell.json
(see cSpell for more settings).
Done.
README.md, line 174 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
The key `ignoreRegExpList` is better to use to ignore phrases or combination of
The key
ignoreRegExpList
is used to ignore phrases or combinations of words, such asAppVeyor
, which will be detected as two different words since it consists of two words starting with upper-case letters.
Done.
README.md, line 177 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
To configure cSpell to ignore
AppVeyor
, then we can add a regular expression, in this caseAppVeyor
. This will cause cSpell to ignore part of the text that matches the regular expression.
Done.
@PlagueHO when you have a chance, can you see if I got all the review comments, and there are no new comments? 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost perfect @johlju - but I had one mistake in my suggested text that needs to be corrected.
Reviewed 2 of 2 files at r2.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @PlagueHO)
README.md, line 130 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Done. Thank you for the updated text in the review comments! Much better now! 😄
Doh - slight mistake (from my text): word of phrases -> word or phrases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 3 of 4 files reviewed, 1 unresolved discussion (waiting on @PlagueHO)
README.md, line 130 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
Doh - slight mistake (from my text): word of phrases -> word or phrases
Done. 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r3.
Reviewable status:complete! all files reviewed, all discussions resolved
adding "Common Tests - Spellcheck Markdown Files" in the file
.MetaTestOptIn.json (issue Add spellcheck and URI link validation on Markdown files in tests #211).
settings file
.vscode\cSpell.json
.Common Meta test Opt-In (issue Move section Phased Meta test Opt-In in the README.md #281).
Fixes #211
Fixes #281
Worked on this last evening, there are a bug with this, but sending this in so it is not forgotten in my fork.
This change is