]> Untitled Git - bdk/commitdiff
feat: add `justfile`
authorLuis Schwab <luisschwab@protonmail.com>
Tue, 1 Jul 2025 17:06:39 +0000 (14:06 -0300)
committerLuis Schwab <luisschwab@protonmail.com>
Tue, 1 Jul 2025 17:09:19 +0000 (14:09 -0300)
.github/pull_request_template.md
CONTRIBUTING.md
README.md
justfile [new file with mode: 0644]

index ace7e2cfd77c9011e70feeca20f8f8d2a786cd47..a9bcabef055c546b13b0cbbfe55797ce747f4e06 100644 (file)
@@ -18,9 +18,7 @@ of the PR were done in a specific way -->
 
 #### All Submissions:
 
-* [ ] I've signed all my commits
 * [ ] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
-* [ ] I ran `cargo +nightly fmt` and `cargo clippy` before committing
 
 #### New Features:
 
index 6c89388881144b1b23ac951e97f086b9db4350c6..b7778f7817b9979ad1bb3baf02bb3aff614e2486 100644 (file)
@@ -55,7 +55,7 @@ To facilitate communication with other contributors, the project is making use
 of GitHub's "assignee" field. First check that no one is assigned and then
 comment suggesting that you're working on it. If someone is already assigned,
 don't hesitate to ask if the assigned party or previous commenter are still
-working on it if it has been awhile.
+working on it if it has been a while.
 
 Deprecation policy
 ------------------
@@ -87,7 +87,7 @@ Coding Conventions
 ------------------
 
 This codebase uses spaces, not tabs.
-Use `cargo fmt` with the default settings to format code before committing.
+Run `just check` to check formatting, linting, compilation and commit signing, `just fmt` to format code before commiting, and `just test` to run tests for all crates.
 This is also enforced by the CI.
 All public items must be documented. We adhere to the [Rust API Guidelines](https://rust-lang.github.io/api-guidelines/about.html) with respect to documentation.
 
@@ -105,6 +105,10 @@ Note that BDK is currently considered "pre-production" during this time, there
 is no special handling of security issues. Please simply open an issue on
 Github.
 
+BDK requires all commits to be signed using PGP. Refer to
+[this guide](https://git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work)
+if you don't have a PGP key set up with `git` yet.
+
 Testing
 -------
 
@@ -117,16 +121,16 @@ effort.
 First Time Contributors
 -----------------------
 
-If it is your first time contributing to the BDK family of libraries, welcome! We're glad to have you with us. If your 
-first (or few first) PRs are focused on very small fixes to documentation, however, they might not meet our threshold 
+If it is your first time contributing to the BDK family of libraries, welcome! We're glad to have you with us. If your
+first (or few first) PRs are focused on very small fixes to documentation, however, they might not meet our threshold
 for acceptance for first time contributors.
 
-Minor grammar and punctuation fixes aren't a good way to start contributing to a project, and instead we suggest you 
-start with something a little more substantial. It's better to find an issue where you can demonstrate some knowledge 
-of bitcoin or the code base, such as improving the substance of documentation, testing, or fixing some small issue 
+Minor grammar and punctuation fixes aren't a good way to start contributing to a project, and instead we suggest you
+start with something a little more substantial. It's better to find an issue where you can demonstrate some knowledge
+of bitcoin or the code base, such as improving the substance of documentation, testing, or fixing some small issue
 even if it's considered low priority.
 
-This being said we are always looking forward to working with new folks interested in contributing to our libraries. 
+This being said we are always looking forward to working with new folks interested in contributing to our libraries.
 If you are looking for issues to work on, check out the good first issue label and join our Discord server!
 
 Going further
index 27d5448eebe863b94a8e5280edbe1f5bc6deb31a..635489d8be9626c4f2d943795780a689fc538a02 100644 (file)
--- a/README.md
+++ b/README.md
@@ -39,7 +39,7 @@ The workspace in this repository contains several crates in the `/crates` direct
 | [`bitcoind_rpc`](./crates/bitcoind_rpc) | Extends [`bitcoincore-rpc`] for emitting blockchain data from the `bitcoind` RPC interface in the form that [`bdk_chain`] and `Wallet` can consume. | ![BitcoinD RPC Crate Info](https://img.shields.io/crates/v/bdk_bitcoind_rpc.svg) ![BitcoinD RPC API Docs](https://img.shields.io/badge/docs.rs-bdk_bitcoind_rpc-green) |
 | [`file_store`](./crates/file_store) | Persistence backend for storing chain data in a single file. Intended for testing and development purposes, not for production. | ![File Store Crate Info](https://img.shields.io/crates/v/bdk_file_store.svg) ![File Store API Docs](https://img.shields.io/badge/docs.rs-bdk_file_store-green) |
 
-The [`bdk_wallet`] repository and crate contains a higher level `Wallet` type that depends on the above lower-level mechanism crates. 
+The [`bdk_wallet`] repository and crate contains a higher level `Wallet` type that depends on the above lower-level mechanism crates.
 
 Fully working examples of how to use these components are in `/examples`:
 
@@ -68,6 +68,12 @@ The following BDK crates maintains a MSRV of 1.63.0. To build these crates with
 
 The MSRV of the `bdk_electrum` crate is 1.75.0.
 
+## Just
+
+This project has a [`justfile`](/justfile) for easy command running. You must have [`just`](https://github.com/casey/just) installed.
+
+To see a list of available recipes: `just`
+
 ## License
 
 Licensed under either of
diff --git a/justfile b/justfile
new file mode 100644 (file)
index 0000000..b5ca94d
--- /dev/null
+++ b/justfile
@@ -0,0 +1,59 @@
+alias b := build
+alias c := check
+alias f := fmt
+alias t := test
+alias p := pre-push
+
+_default:
+  @just --list
+
+# Build the project
+build:
+   cargo build
+
+# Check code: formatting, compilation, linting, and commit signature
+check:
+   cargo +nightly fmt --all -- --check
+   cargo check --workspace --all-features
+   cargo clippy --all-features --all-targets -- -D warnings
+   @[ "$(git log --pretty='format:%G?' -1 HEAD)" = "N" ] && \
+       echo "\n⚠️  Unsigned commit: BDK requires that commits be signed." || \
+       true
+
+# Format all code
+fmt:
+   cargo +nightly fmt
+
+# Run all tests for all crates with all features enabled
+test:
+   @just _test-bitcoind_rpc
+   @just _test-chain
+   @just _test-core
+   @just _test-electrum
+   @just _test-esplora
+   @just _test-file_store
+   @just _test-testenv
+
+_test-bitcoind_rpc:
+    cargo test -p bdk_bitcoind_rpc --all-features
+
+_test-chain:
+    cargo test -p bdk_chain --all-features
+
+_test-core:
+    cargo test -p bdk_core --all-features
+
+_test-electrum:
+    cargo test -p bdk_electrum --all-features
+
+_test-esplora:
+    cargo test -p bdk_esplora --all-features
+
+_test-file_store:
+    cargo test -p bdk_file_store --all-features
+
+_test-testenv:
+    cargo test -p bdk_testenv --all-features
+
+# Run pre-push suite: format, check, and test
+pre-push: fmt check test