docs icon indicating copy to clipboard operation
docs copied to clipboard

feat: ensure formatting and linting checks done on local development are required for PRs to pass

Open jcstein opened this issue 1 year ago • 2 comments

Problem

I've hit errors a lot recently from PRs made on Github UI or without using dependencies (Husky) that cause errors down the line once someone does contribute to site and test locally, or install deps.

Screenshot 2024-02-06 at 5 30 47 PM

The current linting and formatting checks done by Husky are only performed if the user installs dependencies and commits after doing this. If someone does not build the site, or install dependencies, locally, then they would be able to push bypassing the protections aimed at being accomplished in the automation.

Solution

Add CI checks for linting and formatting. Review husky and package.json to make sure that the flow makes sense. https://github.com/celestiaorg/docs/blob/2b46222b62f6719cabf12ed33354caa91df27cbc/package.json#L7-L9

jcstein avatar Feb 06 '24 22:02 jcstein

Try using git hooks instead. celestia node example: https://github.com/celestiaorg/celestia-node/blob/main/.githooks/pre-commit this then runs whenever someone does git commit and it'll prevent the commit from being made if there is a failures.

this this the install command https://github.com/celestiaorg/celestia-node/blob/e55e1c88708b46839867bcbbed9bcdd8a3ffa830/Makefile#L29C1-L33C22 You should be able to do that in the package.json scripts.

MSevey avatar Feb 07 '24 15:02 MSevey

UX issue to be solved for local dev

Bidon15 avatar Mar 11 '24 17:03 Bidon15