Open-Source Wikis

/

Starship

/

How to contribute

/

Tooling

starship/starship

Tooling

The build system, linters, formatters, and CI machinery that live alongside the source.

Cargo

File Purpose
Cargo.toml Crate manifest. Declares MSRV (rust-version = "1.90"), edition 2024, dependencies, features.
Cargo.lock Pinned versions. Committed (Starship is a binary, not a library).
build.rs Compile-time codegen: bakes presets into the binary, builds Windows resources. Uses shadow-rs.
clippy.toml Project-tuned clippy: disallowed methods, etc.
.rustfmt.toml Stable rustfmt overrides.

Features

[features]
default = ["battery", "notify"]
battery = ["starship-battery"]
config-schema = ["schemars"]
notify = ["notify-rust"]
  • battery — pulls in starship-battery. Disable on platforms where the underlying crate doesn't build (Termux is the canonical example).
  • notify — desktop notifications via notify-rust. Disable for Darwin under Nix per the comment in Cargo.toml.
  • config-schema — adds the starship config-schema subcommand and links in schemars.

Disallowed methods

clippy.toml includes a disallowed-methods list that prevents direct use of std::process::Command::new, std::env::var, etc., from inside modules. Modules must go through Context::exec_cmd, Context::get_env, or crate::utils::create_command so tests can mock them.

#![warn(clippy::disallowed_methods)] is set on both src/main.rs and src/lib.rs. CI runs clippy with -D warnings, so the warning is effectively an error in PRs.

rustfmt

cargo fmt --all

.rustfmt.toml is short — sets edition = "2024" and a couple of small overrides. Run before every commit. CI's rustfmt job (.github/workflows/workflow.yml) fails the build if the diff is non-empty.

clippy

cargo clippy --all-targets --all-features -- -D warnings

CI runs the same command on three platforms (Ubuntu, macOS, Windows). The Windows clippy job catches cfg(windows)-gated code that the other platforms can't see.

dprint

Markdown, TOML, JSON, and YAML are formatted by dprint. .dprint.json declares the formatters and per-file plugins.

dprint fmt           # Format everything
dprint fmt path/...  # Format a subset

A separate workflow (.github/workflows/format-workflow.yml) can fix dprint formatting drift on demand via a PR comment trigger.

typos

typos.toml configures the typos spell-checker. The spell-check.yml workflow runs it on every push.

cargo install typos-cli
typos

Adding a project-specific term to the dictionary is done via typos.toml's [default.extend-words] table.

cargo-deny / security audit

deny.toml configures cargo-deny for license and advisory checks. The security-audit.yml workflow runs it weekly via cargo audit (separate tool, but same purpose).

release-please

release-please-config.json tells release-please how to bump versions and assemble the changelog. Conventional Commits are the input.

The release flow:

  1. PRs land on main with conventional commits.
  2. release-please opens a "Release vX.Y.Z" PR that bumps Cargo.toml and updates CHANGELOG.md.
  3. Merging that PR creates a vX.Y.Z tag.
  4. release.yml builds binaries for all targets, publishes to crates.io, attaches artifacts to the GitHub release, and runs the SignPath signing flow for Windows.

crowdin

Translations of docs/ are managed by Crowdin. crowdin.yml configures the file mapping. The crowdin-pretranslate.yml workflow can prefill translations from machine translation. Editing per-locale Markdown files directly will cause merge conflicts — go through Crowdin instead.

VitePress docs site

cd docs
npm install
npm run dev

The publish-docs.yml workflow deploys the site on push to main. .vitepress/ holds the navigation/sidebar config.

codecov

.codecov.yml configures coverage thresholds. CI uploads lcov.info from cargo llvm-cov after every test run on the canonical repo.

Renovate

.github/renovate.json5 configures the bot. It groups dependency updates by ecosystem and time of week. This is why Cargo.lock and Cargo.toml are the most-touched files in the repo.

SignPath

Windows binaries are signed via SignPath.io. The signing roles are GitHub teams starship/astronauts (reviewers) and starship/mission-control (approvers/authors). The README has a "Code Signing Policy" section. The signing step is gated to runs on the canonical starship/starship repository (so PRs from forks don't try to sign).

Local linting recipe

Everything in one go:

cargo fmt --all && \
cargo clippy --all-targets --all-features -- -D warnings && \
cargo test --all-features --locked --workspace && \
dprint fmt && \
typos

If you've also touched a config struct:

cargo run --features config-schema -- config-schema > .github/config-schema.json

See also

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Tooling – Starship wiki | Factory