Skip to content

CI: add typos-action to GHA #1679

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

Open
wants to merge 10 commits into
base: development
Choose a base branch
from

Conversation

ccoVeille
Copy link
Contributor

@ccoVeille ccoVeille commented Apr 24, 2025

  • chore: rename file with typo in it
  • fix: typos in documentation and code
  • ci: add typos detection in GitHub actions

Fixes #1666

It follows

@ccoVeille
Copy link
Contributor Author

This should help from now to avoid typos in code and documentation.

@ccoVeille ccoVeille changed the title typos CI: add typos-action to GHA Apr 29, 2025
@ccoVeille
Copy link
Contributor Author

ccoVeille commented Apr 29, 2025

It's funny CI caught the exact example that was added to CONTRIBUTING via d371668 that @Omar8345 added for

I made changes to avoid this

@Omar8345
Copy link
Contributor

@ccoVeille how funny - the CI definitely overdid its job here! 😂

@ccoVeille ccoVeille marked this pull request as draft April 29, 2025 10:57
@ccoVeille
Copy link
Contributor Author

I convert it back to draft, as I have a few changes to do.

It would help, and I need to fix a few things, instead of disabling words like "typ" and "ba", that detects real typo

I don't want this PR to be merged yet.

@ccoVeille ccoVeille marked this pull request as ready for review April 29, 2025 13:39
@ccoVeille
Copy link
Contributor Author

Code is now ready to be reviewed, and merged if accepted like this

cc @Omar8345 if you are curious

The configuration was updated to include the following:
- ability to ignore specific line
- ability to ignore block of code

We can then disable the check in CONTRIBUTING.md file, which mentioned
"favour" as British English spelling that should be avoided.

We had to handle the exception.
This change might seems unnecessary, but it is important to enable spell check

This would avoid false negative with "type" written "typ".
This change might seems unnecessary, but it is important to enable spell checker.

"ba" would be reported as a typo of the verb "be"

Also, the code is about basic auth provider, so using "bap" is not a problem
No code changes.

This commit includes the following changes:
- "ba" used instead of "be" in a comment
- "typ" use instead of "type" in a JSON string in a test.
@ccoVeille
Copy link
Contributor Author

@Umang01-hash @vikash @coolwednesday @aryanmehrotra

Is there anything blocking with thie PR?

@Omar8345
Copy link
Contributor

Omar8345 commented May 1, 2025

@ccoVeille nice catch for this issue, all the best

@Umang01-hash
Copy link
Member

@ccoVeille the PR looks good to me.
One minor suggestion is can we run this typo's job parallel to our other jobs instead of a new workflow. This way we can complete all the checks in a single workflow run.

@ccoVeille
Copy link
Contributor Author

ccoVeille commented May 5, 2025

One minor suggestion is can we run this typo's job parallel to our other jobs instead of a new workflow. This way we can complete all the checks in a single workflow run.

I'm afraid I don't understand the point.

Here is my understanding of the GitHub CI via GHA

  • all workflows are run in parallel, there is no logic of ordering
  • all jobs in a workflow are run in parallel
  • steps are run sequentially in a job

Right now, there are two workflows:

  • one for the website (only for when a release is tagged)
  • one for the code (docs/ is excluded)

I set up the typos workflows in a way typos detection is launched only once, in a way one PR containing one typo in the code and one typo in the documentation will lead to one job failing and not two, to make it easier to follow.

Maybe I don't understand what you meant,
so please let me know if it's clearer

@Umang01-hash
Copy link
Member

One minor suggestion is can we run this typo's job parallel to our other jobs instead of a new workflow. This way we can complete all the checks in a single workflow run.

I'm afraid I don't understand the point.

Here is my understanding of the GitHub CI via GHA

  • all workflows are run in parallel, there is no logic of ordering
  • all jobs in a workflow are run in parallel
  • steps are run sequentially in a job

Right now, there are two workflows:

  • one for the website (only on docs/)
  • one for the code (docs/ is excluded)

I set up the typos workflows in a way typos detection is launched only once, in a way one PR containing one typo in the code and one typo in the documentation will lead to one job failing and not two, to make it easier to follow.

Maybe I don't understand what you meant, so please let me know if it's clearer

@ccoVeille I meant to say let's add it as a step in existing workflow.

@ccoVeille
Copy link
Contributor Author

As discussed here, and then on Discord in DM with @Umang01-hash , the current workflows files cannot help us.

The main raison are that:

  • website workflow is only called with something is tagged. So it's too late to catch things
  • go workflow is not called when the documentation is updated via a PR

@coolwednesday
Copy link
Contributor

As discussed here, and then on Discord in DM with @Umang01-hash , the current workflows files cannot help us.

The main raison are that:

  • website workflow is only called with something is tagged. So it's too late to catch things
  • go workflow is not called when the documentation is updated via a PR

Hey @ccoVeille , I would suggest having the docs ignore filter added in each job, instead of at the very start of the workfkow file. In that case you would be able to control what jobs should run how.

Copy link
Contributor

@coolwednesday coolwednesday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set up a typo detectors, focused on American English
4 participants