typos icon indicating copy to clipboard operation
typos copied to clipboard

Automatically fix all the typos in typos workflow

Open Mohitkumar6122 opened this issue 2 years ago • 10 comments

I hope is there any way in which I can automatically fix all the errors pointed out by the typos workflow run.

Mohitkumar6122 avatar Oct 12 '21 14:10 Mohitkumar6122

I've seen other Actions that fix PRs or master, so this is inline with them. Personally, I've not quite understood them though

  • If you squash merge or have a single-commit, then the workflow can just squash. Otherwise, you wouldn't want it to squash and it adds noise to your history
  • I guess the user has to always do a force-push (and not even with lease) and have the spell checker run again if they make an update to a PR?

In the mean time, a workaround is to have everyone use the pre-commit

epage avatar Oct 12 '21 14:10 epage

@epage, Can you provide me with a sample format that can skip files during typos workflow run ? Something like this if I want to skip filename.json and Foldername during the typos workflow run?

with: 
        files:  ./filename.json
                ./FolderName/ 
        isolated : true

Mohitkumar6122 avatar Oct 12 '21 14:10 Mohitkumar6122

Please start a Discussion or an Issue for a support question so we can keep the conversation on issues more focused.

epage avatar Oct 12 '21 14:10 epage

Sorry, @epage for closing this issue! and asking so many doubts 😅.

Mohitkumar6122 avatar Oct 12 '21 15:10 Mohitkumar6122

Thank you for such a nice tool! Would be great to have ability to fix while using GitHub actions. If you add a flag to configuration so it pass write it solve the issue :).

How hard is it?

What do you think about compile to wasm so typo can be used from node.js?

coderaiser avatar May 12 '22 16:05 coderaiser

If you add a flag to configuration so it pass write it solve the issue :).

Could you clarify what you mean?

What do you think about compile to wasm so typo can be used from node.js?

I'd be willing to take a contribution along those lines. I've not messed with wasm workflows or node.js integration yet and don't have the time at the moment,

epage avatar May 12 '22 17:05 epage

Could you clarify what you mean?

Right now when I want to fix typos in source code I have two variants using cli:

  • read the message and do it myself;
  • use a flag --write-changes and let typos fix it;
typos --write-changes

I want to have autofix for Github Actions, so when it find fixes, it make changes and does the commit stuff. Something like https://github.com/EndBug/add-and-commit/ but for typos.

coderaiser avatar May 12 '22 17:05 coderaiser

Could you please tell me what exit code 2 mean?

image

I'm trying to setup github actions to autofix typos using cli version.

coderaiser avatar May 12 '22 17:05 coderaiser

Sorry for the delay. exit code 1 is a processing error while exit code 2 means a typo was found. We also use a couple more exit codes for various cases.

epage avatar May 19 '22 02:05 epage

I want to have autofix for Github Actions, so when it find fixes, it make changes and does the commit stuff. Something like https://github.com/EndBug/add-and-commit/ but for typos.

I've implemented auto-fix in my reuseable workflow. You can check the code at:

https://github.com/kdeldycke/workflows/blob/b3ca0119417ab717b6af9271e06448c583024618/.github/workflows/docs.yaml#L23-L51

kdeldycke avatar Apr 16 '24 06:04 kdeldycke