indiainvestments / indiainvestments.github.io

India Investments community website.
https://indiainvestments.github.io
Apache License 2.0
34 stars 8 forks source link

Prettier formatter and pre-commit hook added #25

Closed rajatdhoot123 closed 3 years ago

rajatdhoot123 commented 3 years ago

Huskey Integrated for the pre-commit hook with prettier formatting so all the contributors have the same formatted code before pushing so we are able to check diff more accurately and the same formatted code will push into the production irrespective of code editor settings

It might solve the first point of the issue https://github.com/indiainvestments/indiainvestments.github.io/issues/22#issue-804320069

crimelabs786 commented 3 years ago

Hi @rajatdhoot123, thanks for submitting this PR.

We'd appreciate if you'd have informed us or talked to someone in our Discord before raising this PR.

In any case, I already have a PR open on another repo, and would've ported that here when needed: https://github.com/indiainvestments/faq-to-discord-action/pull/2

This repository does not need Prettier at the moment, it has only a single config file that uses JS. Most of the JS / TS stuff, for now, is in another repository. This is mostly going to be a repository of Markdown files, with some JSON / YAML config files.


As for the issue you've linked, it's to investigate & estimate the builds and check if we're remaining below free quota. But not to actually add the builds.

Please don't be disheartened, we appreciate your inputs & effort. But do talk to us on Discord or Reddit or even in the issue comments section, before raising any pull requests.

rajatdhoot123 commented 3 years ago

Totally fine but why we are not using prettier markdowns for any particular reason because if there are many contributors then their way of writing will be different and then visualizing diff becomes hard.

crimelabs786 commented 3 years ago

@rajatdhoot123 ok, please send a PR that adds PR, and uses lint-staged to prettify markdown, YAML, JS, and JSON file. Don't add any action yet.

rajatdhoot123 commented 3 years ago

Don't add any action yet -> like no pre-commit hook...?

crimelabs786 commented 3 years ago

@rajatdhoot123 no, a pre-commit hook is fine. Don't add any GitHub action in workflow yet.

rajatdhoot123 commented 3 years ago

Cool there is no git hub action added simple code formatting on pre-commit nothing else will raise PR