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

Prettier + Husky linting #377

Merged
merged 4 commits into from
Aug 17, 2023
Merged

Conversation

marceljay
Copy link
Contributor

@marceljay marceljay commented Aug 15, 2023

Setting the stage for pre-commit hooks.
This means that now with a yarn install, husky will be installed which is a tool to execute commands before git commit.
Along with that is installed lint-staged which makes sure only files in the staging environment are "linted" (even though ESLint isn't used yet).

The PR also updates Prettier and sets rules that are somewhat basic, but because even they would cause issues, a lot of directories are excluded so far. This must be addressed soon, because effectively, prettier isn't doing much now. But at least new files or existing dirs that are not ignored have to follow the rules.

The PR also introduces checks for conventional commit linting.

@marceljay marceljay changed the base branch from main to dev August 15, 2023 15:25
@marceljay marceljay marked this pull request as draft August 15, 2023 17:08
For better formatting and clean commits, we want pre-commit hooks
via husky. Lint-staged is added and prettier updated.
Running prettier would cause a lot of errors. The ignore settings
are used so that no more errors occur on existing files.

This can be corrected later, by either coming up with override rules
or fixing the issues one-by-one.
Lint-staged works on the git staging files.
Postinstall is executed after `yarn install` setting up husky.
@marceljay marceljay marked this pull request as ready for review August 16, 2023 13:48
This will make sure the commit linted according to conventional commits
which have been adopted after discussion. See `docs/coding-standards.md`.

If commits contain the string 'WIP' they will be ignored and bypass
the commit linting.
@marceljay marceljay merged commit eaf0291 into kumo-earth:dev Aug 17, 2023
4 checks passed
@marceljay marceljay changed the title [WIP] Prettier + Husky linting Prettier + Husky linting Aug 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants