bitcoin-dev-project / warnet

Monitor and analyze the emergent behaviors of Bitcoin networks
https://warnet.dev
MIT License
81 stars 35 forks source link

create ruff format as a pre-commit hook #467

Open josibake opened 4 weeks ago

josibake commented 4 weeks ago

if I have a CI failure for ruff formatting one more time........ :rage4:

willcl-ark commented 3 weeks ago
echo '#!/bin/sh
uvx ruff format . --check
uvx ruff check .' > .git/hooks/pre-commit

chmod +x .git/hooks/pre-commit

Very much like doom guy emoji, did not know he was here :)

willcl-ark commented 6 days ago

Shall we close this? you can just add the precommit hook yourself. Unless you are talking about this pre-commit?

josibake commented 5 days ago

Can close, I added your script locally. I do, however, think we should mention this (maybe we do?) in a contributing document and provided a sample script for users to install. It's pretty annoying when a new contributor opens a PR , and the first thing we gotta do is say "hey can you run ruff format?"