anitab-org.github.io icon indicating copy to clipboard operation
anitab-org.github.io copied to clipboard

chore: add pretty-quick dependency

Open ftonato opened this issue 2 years ago • 7 comments

Description

We are adding "pretty-quick" as an alternative to "Prettier Action", your responsibility is to run "prettier" when we change any file (respecting the defined default) when we commit it, thus maintaining consistency between all commits.

Fixes #326

Type of Change:

  • Chore

Code/Quality Assurance Only

  • This change requires a documentation update (software upgrade on readme file) (https://github.com/anitab-org/anitab-org.github.io/pull/324)

How Has This Been Tested?

  1. Perform any change in one .js file
  2. Save it and try to commit
  3. If there's any different format that what prettier expects, the file will be modified and a message will appear in the terminal:

image

Checklist:

  • [X] My PR follows the style guidelines of this project
  • [X] I have performed a self-review of my own code or materials

/c @isabelcosta & @brittanyjoiner15

ftonato avatar Oct 22 '21 10:10 ftonato

No need for apologies @brittanyjoiner15 thank you for working on this and being so proactive 💯 @ftonato this option looks good. Just as a note, it's difficult to be sure that the contributor ran prettier tool. So we probably want some automated check for this, in the future.

isabelcosta avatar Oct 23 '21 12:10 isabelcosta

Explanatory note: The contributor doesn't need to do anything, when they commits the command will be trigged automatically (unless they say that they want to ignore it being executed with the --no-verify flag), otherwise everything will work perfectly and they won't even know ;)

/c @isabelcosta

ftonato avatar Oct 23 '21 12:10 ftonato

The contributor doesn't need to do anything

@ftonato won't they have to run "husky install" (from line "prepare": "husky install") or install pre-commit tool prior to commit?

isabelcosta avatar Oct 23 '21 13:10 isabelcosta

do you use npm to regenerate dependencies, I was trying now. and yarn install is the way we use 🤔

Can you regenerate using that?

isabelcosta avatar Oct 23 '21 14:10 isabelcosta

@ftonato just as fyi I just removed the gh action prettier job to unblock deployments. This PR is still valid, let me know what you think when you have the time

isabelcosta avatar Oct 23 '21 14:10 isabelcosta

do you use npm to regenerate dependencies, I was trying now. and yarn install is the way we use 🤔

Can you regenerate using that?

It's like I said, they don't need to do anything.

I use NPM, but I can test with YARN to see that no problems happen.

See the example flow below:

  1. Removed node_modules
  2. yarn install
  3. I opened my code editor in the current directory
  4. I changed a file and ran git add .

I knew the file didn't follow the expected formatting, and when I tried to run git commit it pretty magically did the job it was supposed to ;)

image

/ c @isabelcosta

ftonato avatar Oct 23 '21 15:10 ftonato

do you use npm to regenerate dependencies, I was trying now. and yarn install is the way we use 🤔 Can you regenerate using that?

It's like I said, they don't need to do anything.

I use NPM, but I can test with YARN to see that no problems happen.

See the example flow below:

  1. Removed node_modules
  2. yarn install
  3. I opened my code editor in the current directory
  4. I changed a file and ran git add .

I knew the file didn't follow the expected formatting, and when I tried to run git commit it pretty magically did the job it was supposed to ;)

image

/ c @isabelcosta

Really appreciate your efforts @ftonato 👏

narayand16 avatar Oct 28 '21 13:10 narayand16

I'm closing outdated issues and pull-requests that are no longer relevant given how much time has passed since they were opened.

ftonato avatar Feb 23 '23 09:02 ftonato