Skip to content

feat: add justfile #1979

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

luisschwab
Copy link
Member

@luisschwab luisschwab commented Jun 18, 2025

Description

Closes #1967.

This PR adds a justfile, updates the PR template to use it, and adds a section on the README.md to show available recipes.

These are the implemented recipes:

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 on the workspace with all features
test:
   cargo test --workspace --all-features

# Run pre-push suite: format, check, and test
pre-push: fmt check test

check will verify if HEAD was signed and echo that warning if not. It does not check all commits, but I think that checking only the last is a pretty good heuristic (who only signs the last commit?).

Before pushing, one only needs to run just p.

Checklists

All Submissions:

@luisschwab luisschwab self-assigned this Jun 18, 2025
@luisschwab luisschwab moved this to Needs Review in BDK Chain Jun 18, 2025
@luisschwab
Copy link
Member Author

Did some thinking on this. Should we really exclude examples from formatting?

@notmandatory
Copy link
Member

You mean exclude examples from cargo check? I think the only reason we exclude them in CI was to avoid MSRV dependency issues, but for this Justfile it shouldn't be a problem so probably should be checking everything.

@luisschwab
Copy link
Member Author

luisschwab commented Jun 18, 2025

Yes, check and also fmt --check.

@luisschwab
Copy link
Member Author

luisschwab commented Jun 18, 2025

If there are no objections I'll make these changes on bdk_wallet as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Needs Review
Development

Successfully merging this pull request may close these issues.

Create justfile
2 participants