-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add pre-commit #122
Comments
I can pick this up as well seeing as im doing, bitcart/bitcart-blog#110 |
Alright, our js repos will share same config anyway. |
Wait do you want to use the same |
The same pre-commit library as in python. It is installed via numerous ways, one of which is via python, and it can run git hooks in any language. It can run prettier, eslint, some misc formatters and so on without requiring user to manually install them |
Ok sure I guess we assume the user already has it installed ? or shall I update the README with say how to do it via curl ? |
For js repos we can't assume user has python installed, so yes, installing via curl method should be documented (and a link to pre-commit install docs showing all methods) |
alright cool, I can do that! |
Im sorry about the delay working on this, i've been super busy with stuff at work. Happy to hand this over to someone else if you want. Sorry |
The nature of opensource is that anyone can contribute, there is no need to assign because everyone does stuff in their free time. I can unassign you if you want to not confuse others, but feel free to submit PR any time! |
Pre-commit hooks should be added, documented and applied as we did in all our python repositories.
Pre-commit hooks are to be added by
pre-commit
app: https://pre-commit.com/See those pull requests for reference: bitcart/bitcart#238, bitcart/bitcart-sdk#32, bitcart/bitccl#13
Of course, python-related tasks should be removed, and a set of rules for js repos should be created. Pre-commit checks should run most basic checks for file consistency (newlines, trailing whitespaces, etc), also probably eslint with our config (so that it runs prettier too) and any other useful checks for js code
We currently use husky for pre-commit hooks. Preferably pre-commit would also run the linting run by husky, or just run husky itself
The main issue is to make pre-commit use versions from package.json without manually specifying them in it's config file
Important: the pull request will be merged without squash, so please try to make it like reference PRs, first commit adding the pre-commit config, and in next commits applying fixers one by one, and in last commits documenting it and adding to CI. To add to CI you can use bitcartcc/lint action by our bitcartcc/bitcartcc-shared orb. See other pull requests for reference
The text was updated successfully, but these errors were encountered: