-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 support (config, workflow to detect/not fix) and make it fix few typos #2296
Conversation
=== Do not change lines below === { "chain": [], "cmd": "codespell -w -i 3 -C 2 ./pkg/common/git/git.go", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^
Hi Yaroslav, I remember I had refused your PR like this to Gitea because it touched too many files (50+) involving docs, js, go files and template files, making it almost impossible to review. Sorry again if it made you unhappy. However, for this PR, I don't see any reason not to go, all changes are all reasonable and reviewable. 👍 |
pkg/runner/hashfiles/index.js
Outdated
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.
I am sure if we should touch index.js
since I remember it's copied from actions/runner
.
@ChristopherHX I think you should take a look.
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.
Yes I would prefer to exclude that pkg/runner/hashfiles/index.js file, it's an 1:1 copy.
actions/tookit still has that typos, should be fixed there.
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.
cool, excluded
here is the force pushed diff
❯ git diff gh-yarikoptic/enh-codespell..
diff --git a/.codespellrc b/.codespellrc
index fe7ef1c..4857dfe 100644
--- a/.codespellrc
+++ b/.codespellrc
@@ -1,6 +1,6 @@
[codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
-skip = .git*,go.sum,package-lock.json,*.min.*,.codespellrc,testdata
+skip = .git*,go.sum,package-lock.json,*.min.*,.codespellrc,testdata,./pkg/runner/hashfiles/index.js
check-hidden = true
ignore-regex = .*Te\{0\}st.*
# ignore-words-list =
diff --git a/pkg/runner/hashfiles/index.js b/pkg/runner/hashfiles/index.js
index 37e21db..f2bed37 100644
--- a/pkg/runner/hashfiles/index.js
+++ b/pkg/runner/hashfiles/index.js
@@ -942,10 +942,10 @@ class Summary {
return this.addRaw(element).addEOL();
}
/**
- * Adds a collapsible HTML details element to the summary buffer
+ * Adds a collapsable HTML details element to the summary buffer
*
* @param {string} label text for the closed state
- * @param {string} content collapsible content
+ * @param {string} content collapsable content
*
* @returns {Summary} summary instance
*/
@@ -1844,7 +1844,7 @@ class Pattern {
// false for `/foo` but returns true for `/foo/`. Append a trailing slash to handle that quirk.
if (!itemPath.endsWith(path.sep)) {
// Note, this is safe because the constructor ensures the pattern has an absolute root.
- // For example, formats like C: and C:foo on Windows are resolved to an absolute root.
+ // For example, formats like C: and C:foo on Windows are resolved to an aboslute root.
itemPath = `${itemPath}${path.sep}`;
}
}
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2296 +/- ##
===========================================
+ Coverage 61.56% 76.55% +14.98%
===========================================
Files 53 59 +6
Lines 9002 7506 -1496
===========================================
+ Hits 5542 5746 +204
+ Misses 3020 1238 -1782
- Partials 440 522 +82 ☔ View full report in Codecov by Sentry. |
Thank you @wolfogre ! FWIW -- we can exclude any file you like from being checked/fixed by codespell. my 1c: Number of files with typos is not an indicator of deficiency in the goal of having typo free code base ;-) typos are usually easy to spot and relatively easy to review IMHO since it is quite often a typo or two in a file. GitHub also provides means to mark reviewed files so they collapse. So it becomes a matter of a few quality minutes of time to review and then live with (much more so) typo free codebase . But indeed a number of files quite often scary people away, but I can find some brave projects which made the dive and so far I have not heard much of complaints. |
=== Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^
6807e27
to
f4a057c
Compare
More about codespell: https://github.com/codespell-project/codespell .
I personally introduced it to dozens if not hundreds of projects already and so far only positive feedback.
CI workflow has 'permissions' set only to 'read' so also should be safe.