Skip to content
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

chore: add pretty-quick dependency #325

Closed
wants to merge 1 commit into from

Conversation

ftonato
Copy link
Contributor

@ftonato ftonato commented Oct 22, 2021

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

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:

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

/c @isabelcosta & @brittanyjoiner15

Copy link
Contributor

@brittanyjoiner15 brittanyjoiner15 left a comment

Choose a reason for hiding this comment

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

💯 % agree with this. I think i am not very familiar with GH actions, so probably should not have implemented that to start with, so my apologies 😭 . Glad we have something else in place that @ftonato seems more familiar with! I am good with this!

@isabelcosta
Copy link
Member

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.

@ftonato
Copy link
Contributor Author

ftonato commented Oct 23, 2021

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

@isabelcosta
Copy link
Member

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
Copy link
Member

isabelcosta commented Oct 23, 2021

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
Copy link
Member

@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

@ftonato
Copy link
Contributor Author

ftonato commented Oct 23, 2021

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

@narayand16
Copy link
Contributor

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 👏

@vj-codes vj-codes added the Status: Needs Review PR needs an additional review or a maintainer's review. label Oct 30, 2021
@ftonato
Copy link
Contributor Author

ftonato commented Feb 23, 2023

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

@ftonato ftonato closed this Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Review PR needs an additional review or a maintainer's review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace Prettier Action with pretty-quick pre-commit
5 participants