gofr icon indicating copy to clipboard operation
gofr copied to clipboard

typos

Open ccoVeille opened this issue 8 months ago • 1 comments

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

Fixes #1666

  • #1666

ccoVeille avatar Apr 24 '25 23:04 ccoVeille

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

ccoVeille avatar Apr 24 '25 23:04 ccoVeille

It's funny CI caught the exact example that was added to CONTRIBUTING via https://github.com/gofr-dev/gofr/commit/d3716681e01753e6dd5555c9bddab6ac5643b54f that @Omar8345 added for

  • https://github.com/gofr-dev/gofr/pull/1678

I made changes to avoid this

ccoVeille avatar Apr 29 '25 05:04 ccoVeille

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

Omar8345 avatar Apr 29 '25 10:04 Omar8345

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 avatar Apr 29 '25 10:04 ccoVeille

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

cc @Omar8345 if you are curious

ccoVeille avatar Apr 29 '25 13:04 ccoVeille

@Umang01-hash @vikash @coolwednesday @aryanmehrotra

Is there anything blocking with thie PR?

ccoVeille avatar Apr 30 '25 19:04 ccoVeille

@ccoVeille nice catch for this issue, all the best

Omar8345 avatar May 01 '25 01:05 Omar8345

@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.

Umang01-hash avatar May 05 '25 04:05 Umang01-hash

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

ccoVeille avatar May 05 '25 06:05 ccoVeille

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.

Umang01-hash avatar May 05 '25 06:05 Umang01-hash

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

ccoVeille avatar May 05 '25 15:05 ccoVeille

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.

coolwednesday avatar May 06 '25 06:05 coolwednesday

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.

That's one way, indeed. I'm fine with doing the following changes, if two people confirm me they are OK with the following plan:

  • include typos detection as a job in the file currently named go.yml
  • update all jobs currently in go.yml to exclude docs/ path
  • prefix all jobs currently in go.yml to mention they are about Go
  • rename go.yml workflow with another name (maybe code.yml)

I can do it, but for me, there is no logic in keeping the number of workflow low.

And here these changes are pretty important for almost no gain.

That said, if there is a consensus in such need, I can do it.

ccoVeille avatar May 06 '25 07:05 ccoVeille

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.

That's one way, indeed. I'm fine with doing the following changes, if two people confirm me they are OK with the following plan:

  • include typos detection as a job in the file currently named go.yml
  • update all jobs currently in go.yml to exclude docs/ path
  • prefix all jobs currently in go.yml to mention they are about Go
  • rename go.yml workflow with another name (maybe code.yml)

I can do it, but for me, there is no logic in keeping the number of workflow low.

And here these changes are pretty important for almost no gain.

That said, if there is a consensus in such need, I can do it.

@coolwednesday I think what @ccoVeille suggested is right. Doing all the above changes just at cost of not making new workflow maybe isn't the best idea.

Umang01-hash avatar May 06 '25 09:05 Umang01-hash

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.

That's one way, indeed. I'm fine with doing the following changes, if two people confirm me they are OK with the following plan:

  • include typos detection as a job in the file currently named go.yml
  • update all jobs currently in go.yml to exclude docs/ path
  • prefix all jobs currently in go.yml to mention they are about Go
  • rename go.yml workflow with another name (maybe code.yml)

I can do it, but for me, there is no logic in keeping the number of workflow low. And here these changes are pretty important for almost no gain. That said, if there is a consensus in such need, I can do it.

@coolwednesday I think what @ccoVeille suggested is right. Doing all the above changes just at cost of not making new workflow maybe isn't the best idea.

Sure, I was suggesting a way around to have it in the same workflow. It is a lot of unnecessary work, indeed. So I do not have problem with the current implementation.

coolwednesday avatar May 06 '25 11:05 coolwednesday