-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add codespell: configuration, workflow (to detect new typos) and have it fixed some typos #5176
Conversation
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #5176 +/- ##
===========================================
+ Coverage 79.38% 85.16% +5.77%
===========================================
Files 166 165 -1
Lines 13886 11166 -2720
Branches 707 698 -9
===========================================
- Hits 11024 9509 -1515
+ Misses 2708 1501 -1207
- Partials 154 156 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Awesome.
We already have cspell. It seems that its configuration needs to be adjusted to cover all the cases. Or may be we should switch to codespell completely? Or keep both?
cspell gives plenty of false positives, but it also gives some interesting results as
/mermaid/packages/mermaid/src/diagrams/gantt/ganttRenderer.js:728:27 - Unknown word (Occurances) fix: (Occurrences)
which either skipped or ignored by codespell.
What do you think?
This is our current config https://github.com/mermaid-js/mermaid/blob/develop/cSpell.json
cool! didn't know or forgot about I guess it could not hurt too much to try both for a while and then possibly kick away codespell or cspell if one annoys more than the other with false positives. Meanwhile filed also to hopefully eventually make |
=== Do not change lines below === { "chain": [], "cmd": "codespell -w -i 3 -C 2", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^
=== Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^
6e659cf
to
b13e752
Compare
CSpell will pick up everything that The patterns found in Lines 166 to 201 in dc857f8
The patterns even impact the ESLint cspell plug-in. Everything in the image with a gray background is not checked. Most of the issuea are cause by the Lines 187 to 189 in dc857f8
and Line 167 in dc857f8
The Moving the "languageSettings": [
{
"languageId": "markdown",
"ignoreRegExpList": [
"Markdown links",
"Markdown code blocks",
"Inline code blocks",
"Link contents",
"Snippet references",
"Snippet references 2",
"Multi-line code blocks",
"HTML Tags"
]
}
], Switching over the patterns:
- name: Markdown links
pattern: \((.*)\)
description: ''
- name: Markdown code blocks
pattern: /^(\s*`{3,}).*[\s\S]*?^\1/gmx
description: Taken from the cSpell example at
https://cspell.org/configuration/patterns/#verbose-regular-expressions
- name: Inline code blocks
pattern: \`([^\`\r\n]+?)\`
description: https://stackoverflow.com/questions/41274241/how-to-capture-inline-markdown-code-but-not-a-markdown-code-fence-with-regex
- name: Link contents
pattern: \<a(.*)\>
description: '' Note: the Markdown dictionary already excludes Markdown Links: cspell-dicts/markdown. Creating a repository dictionary might also be useful to avoid scripts like: fixCSpell.ts It might also be wise to update cspell to 8.x. |
@Jason3S can you please create a PR with the required changes?
That script is to sort and lowercase all the words added by VSCode extension when we use the "Update cSpell.json" command. This avoids merge conflicts as new lines won't be always added at the bottom, and makes it cleaner. |
I'll take a look next week. |
ping on this -- please advise on either should be closed/fixedup/whatnot? |
📑 Summary
See https://github.com/codespell-project/codespell to discover more about project
📏 Design Decisions
Mostly implemented by running https://github.com/yarikoptic/improveit/blob/main/codespellit
📋 Tasks
Make sure you
MERMAID_RELEASE_VERSION
is used for all new features.develop
branch