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

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

Open
jcstein opened this issue Feb 6, 2024 · 2 comments
Assignees
Labels
bug Something isn't working P1 High Priority

Comments

@jcstein
Copy link
Member

jcstein commented Feb 6, 2024

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.

docs/package.json

Lines 7 to 9 in 2b46222

"lint": "eslint --fix",
"lint:md": "markdownlint '**/*.md'",
"format": "prettier --write '**/*.{js,jsx,ts,tsx,md,json,css,scss}'",

@MSevey
Copy link
Member

MSevey commented Feb 7, 2024

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.

@jcstein jcstein self-assigned this Feb 21, 2024
@Bidon15 Bidon15 added the P1 High Priority label Mar 11, 2024
@Bidon15
Copy link
Member

Bidon15 commented Mar 11, 2024

UX issue to be solved for local dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1 High Priority
Projects
None yet
Development

No branches or pull requests

3 participants