Skip to content

fix(cli): build with only the cli feature - #529

Open
HaoZeke wants to merge 1 commit into
mainfrom
fix/cli-only-build
Open

HaoZeke wants to merge 1 commit into
mainfrom
fix/cli-only-build

Conversation

@HaoZeke

@HaoZeke HaoZeke commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator

cargo build --no-default-features --features cli failed on main.
The lsp and watch arms in src/main.rs used tokio, snapper_fmt::lsp and snapper_fmt::watch with no cfg gate, and those exist only with the lsp and watch features.

  • Both arms now follow the mcp arm.
    Built without the feature, snapper lsp or snapper watch prints which feature is missing and exits 1.
  • is_rst_dropped_comment_opener, source_has_dropped_rst_comments, wrap_sentence_plain and verbatim_commands serve only the pandoc or neural paths.
    A cfg_attr allow keeps the cli-only build free of dead-code warnings.
  • The test-features job in wasm.yml runs cargo check --no-default-features --features cli --bins with RUSTFLAGS=-D warnings.
    The workflow file now also triggers that job on pull requests.

The cli-only check fails on main and passes here.
cargo test, cargo test --no-default-features --lib, cargo clippy -- -D warnings and cargo fmt --check pass.

A build with only the cli feature failed.
The lsp and watch arms in main.rs called tokio and the lsp and watch modules with no cfg check.
Those exist only with the lsp and watch features.
Both arms now follow the mcp arm: built without the feature, the subcommand says so and exits 1.
Four helpers that only the pandoc and neural paths call get a cfg_attr allow, so the cli-only build has no dead-code warnings.
The WASM workflow now checks the cli-only binaries with warnings denied, and a change to that workflow triggers it on pull requests too.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant