DevelopersContribute

Contribute to Liana

Discuss a change, prepare a pull request that meets the project's rules, and send documentation fixes to the right repository.

Liana lives in wizardsardine/liana, and CONTRIBUTING.md sets its rules. Bitcoin software calls for rigor, so allow time for several rounds of review.

Discuss a non-trivial change first

Before you implement a non-trivial change, raise it in a GitHub issue, in the Liana Telegram group or on the Liana Discord.

Looking for a first contribution?

git grep for FIXME and TODO, or pick a good first issue.

Prepare the pull request

  • One purpose: A pull request adds a feature, fixes a bug or refactors code, never a mix. Split a large change into focused pull requests.
  • Atomic commits: Keep formatting fixes and code moves out of commits that change code. Each commit builds on its own, without warnings, errors, regressions or test failures.
  • Explained commits: Write a short subject, a blank line, then your reasoning, for the people who read the code later. Skip the body only when the subject explains itself. How to Write a Git Commit Message shows the form.
  • Squashed fixups: When a reviewer asks, squash fixup commits, which edit the same lines again, and commits too small to read on their own.
  • Tests: A new feature comes with tests, ideally a functional test that drives it from outside plus unit tests for its logic.
  • Style: Format with rustfmt and fix what Clippy reports. Format the Python of the functional tests with black.

Build and test with the Rust version that Pick the Rust version gives.

Follow the UI guidelines

liana-gui and the Liana Business installer are Iced applications built on the shared liana-ui crate, Liana's design system. The UI guidelines list its components and the conventions of the view code. Three of them change how you write a patch:

  • Reuse liana-ui: Do not rebuild a widget, a color or a layout primitive that it has. If one is missing, add it to liana-ui, not to the view code. For a new button or pill, add a named helper there first, then use it.
  • Style through the theme: Never hard-code a hex value or a Color. Use the styles of theme.
  • Use the text roles: Never size text by hand. Use the roles of text::new, such as h1 or b1.

Run the CI checks before you push

On Linux, run the checks CI runs on your pull request, from the root of the repository:

cargo fmt -- --check
cargo clippy --all-features --all-targets -- -D warnings
cargo test

CI also runs them, plus a release build, on each earlier commit of a multi-commit pull request, so check every commit. Run the functional tests too, as Run the tests shows, because CI runs them. If you change interface text, update the catalogs as Translate Liana describes, because CI checks them too Requires Liana 16.0+.

Review a pull request

Anyone can review a pull request by commenting on it. Look for obvious mistakes, test the patch, and weigh its technical merits. Judge the concept first, then the style and the wording.

Follow the AI policy

The AI policy welcomes AI coding tools when they add value and do not waste other contributors' time, under these conditions:

  • Write your own comments and describe issues in your own words. The project may moderate a comment that seems AI-written.
  • Open a pull request only if you know its language, could have written the code yourself, and understand the surrounding code and the change's effect.
  • Explain your changes in your own words, in the pull request body and in your answers to reviewers. Never paste an AI's reply.
  • Pick the work yourself and take responsibility for it. No autonomous agent opens or drives a pull request. No agent is an author or co-author of a commit. The project can close a pull request that appears to break this rule without notice.
  • Disclose any context you quote from an AI and explain in your own words why it matters.

To question or change the policy, open a GitHub issue or post on Discord.

Fix a page of this documentation

The source of these pages is LoicPandul/liana-docs, not the Liana repository. Its README.md and CONTRIBUTING.md show how to preview a change, report a wrong page or send the fix.

Next steps