Skip to content

CI: Add codespell config and fix typos#4506

Merged
lastzero merged 5 commits intophotoprism:developfrom
yarikoptic:enh-codespell
Mar 27, 2025
Merged

CI: Add codespell config and fix typos#4506
lastzero merged 5 commits intophotoprism:developfrom
yarikoptic:enh-codespell

Conversation

@yarikoptic
Copy link
Copy Markdown
Contributor

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.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Sep 6, 2024

CLA assistant check
All committers have signed the CLA.

@yarikoptic
Copy link
Copy Markdown
Contributor Author

is there a way to trigger some testing? otherwise -- this is an easy to review PR, don't get scared by number of files, quite often it is just one typo fix per file.

@lastzero
Copy link
Copy Markdown
Member

@yarikoptic I apologize for not getting back to you any sooner!

The reason we've been so reluctant with this is because of security concerns regarding GitHub Actions (especially when adding/modifying them through pull requests). See, for example:

That being said, we'd be happy to merge the spelling fixes without the action configuration and/or add an additional Make target that runs a spell check locally, just like eslint. It would be worth looking at https://github.com/golangci/golangci-lint for this as well, since golangci-lint might be a better and more versatile choice for our needs.

Would that be possible? I'll be happy to help with this and answer any questions :)

@lastzero lastzero added waiting Impediment / blocked / waiting enhancement Enhancement or improvement of an existing feature ci Tests, Continuous Integration, Build and Deployment Automation labels Mar 27, 2025
@lastzero lastzero changed the title Add codespell support (config, workflow to detect/not fix) and make it fix few typos CI: Add code spell checker and fix typos Mar 27, 2025
@yarikoptic
Copy link
Copy Markdown
Contributor Author

sure -- concerns are well understood I must say especially if you have/use some secrets (I might have missed but I do not think you do yet). Anything is fine with me. I can easily redo and drop CI action. Just let me know if you would have time now to review so we do not breed conflicts and require re-doing?

=== 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 ^^^

+ fixed few manually and melded here in frontend/src/css/vendor/icons/material-design-icons.css which was ignored

 Conflicts upon rebased -- files were removed in develop:
	frontend/src/css/vendor/icons/fonts/MaterialIcons-Regular.json
	frontend/src/css/vendor/icons/material-design-icons.css
…agically

=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^
@yarikoptic
Copy link
Copy Markdown
Contributor Author

actually, "easier done than said" so here is an updated -- dropped CI, rebased, added a few ignore pragmas, less changes to review

@lastzero
Copy link
Copy Markdown
Member

Excellent, thank you very much! I'll go ahead and merge this.

@lastzero lastzero removed the waiting Impediment / blocked / waiting label Mar 27, 2025
@lastzero lastzero changed the title CI: Add code spell checker and fix typos CI: Add code spell config and fix typos Mar 27, 2025
@lastzero lastzero changed the title CI: Add code spell config and fix typos CI: Add codespell config and fix typos Mar 27, 2025
@lastzero lastzero merged commit 15668ee into photoprism:develop Mar 27, 2025
2 checks passed
@lastzero lastzero moved this to Preview 🐳 in Roadmap πŸš€βœ¨ Mar 27, 2025
@lastzero lastzero added the merged Changes are merged, but may require further testing label Mar 27, 2025
lastzero added a commit that referenced this pull request Mar 27, 2025
Signed-off-by: Michael Mayer <michael@photoprism.app>
@lastzero
Copy link
Copy Markdown
Member

@yarikoptic This is now included in our preview build! Note that I had to fix some minor issues, for example using # for comments is not allowed in Go. I assume that using // instead shouldn't affect the codespell annotation.

@yarikoptic
Copy link
Copy Markdown
Contributor Author

Oh, so sorry that my Python rotten mind saw everything as Python code. Yes, it should work with a proper to the language comment

@graciousgrey graciousgrey moved this from Preview 🐳 to Release 🌈 in Roadmap πŸš€βœ¨ Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Tests, Continuous Integration, Build and Deployment Automation enhancement Enhancement or improvement of an existing feature merged Changes are merged, but may require further testing

Projects

Status: Release 🌈

Development

Successfully merging this pull request may close these issues.

4 participants