codespell-project / actions-codespell

MIT License
74 stars 19 forks source link

option(s) to submit fixes #68

Open yarikoptic opened 1 year ago

yarikoptic commented 1 year ago

For a PR it would be a commit to the same branch. (we do similar for adding changelog entries to PRs upon a specific label being present: https://github.com/datalad/release-action/blob/master/add-changelog-snippet/action.yml#L23 )

For a run within a non-PR branch - would be a new PR against that branch.

ferdnyc commented 4 months ago

@yarikoptic

Hmm. Certainly doable from the codespell end, since it has a -w mode that writes back changes, and when run that way it reports:

FIXED: relative/path/to/first/file.xtn
FIXED: relative/path/to/other/code.xtn

and etc.

So it'd just be a matter of git add <foo> for each file listed, and then commit the changes.

...Arguably that functionality may be out of scope for this action, though, because it's "codespell with annotations" — and there's no real point in making annotations for spelling errors that are automatically fixed. It's kind of taking things in a different direction, functionality-wise.

A separate action to run codespell and auto-apply the changes, instead of making annotations, might actually make more sense, despite the seeming redundancy of two different actions to run codespell. (In truth there are multiple codespell actions already, so adding an "auto-apply codespell fixes" action would just be expanding the existing set of choices.)

yarikoptic commented 3 months ago

IMHO there is no need for a separate action and indeed could be just a matter of adding an option and committing/pushing. FWIW, here is a "live" fresh request for such a feature

ferdnyc commented 2 months ago

@yarikoptic ¯\_(ツ)_/¯ I'm not a dev/committer here, just another user... but since I'm also the only one who's responded here in over a year, I think it's safe to assume that "quickly" is probably way off the table.

larsoner commented 2 months ago

Would it be enough to allow actions-codespell to have a "write" mode and then you use autofix.ci or something similar to push the fix to the given PR?

I also wonder if it's easier instead to use pre-commit.ci to do it instead for most people

yarikoptic commented 2 months ago

but pushing from CI is easy for a PR, isn't it?

people who use pre-commit.ci typically do not even wan to use actions-codespell since they have codespell in their pre-commit config.