Skip to content

fix(BREAKING): upgrade to dprint-core 0.69.1 and remove anyhow - #64

Merged
dsherret merged 2 commits into
mainfrom
chore/dprint-core-0.69
Aug 21, 2026
Merged

fix(BREAKING): upgrade to dprint-core 0.69.1 and remove anyhow#64
dsherret merged 2 commits into
mainfrom
chore/dprint-core-0.69

Conversation

@dsherret

Copy link
Copy Markdown
Member

Upgrades dprint-core from 0.67.0 to 0.69.0 (keeping the process feature).

Why source changes were needed

dprint-core 0.68.0 removed its anyhow dependency, so the plugin handler APIs now use dprint_core::plugins::FormatError instead of anyhow::Error. FormatResult is now Result<Option<Vec<u8>>, FormatError>, and handle_process_stdio_messages returns Result<(), FormatError>.

Changes

  • Cargo.toml: dprint-core 0.67.0 -> 0.69.0, dropped the direct anyhow dependency.
  • src/handler.rs: replaced anyhow::Error/anyhow::Result/anyhow!/bail! with FormatError and FormatError::new(...). The ? plumbing over JoinError, oneshot::error::RecvError and std::io::Error still works because dprint-core implements From for those on FormatError. SetupInitError::Failed now holds a FormatError.
  • src/main.rs: fn main() -> Result<(), FormatError>.
  • Cargo.toml / tests/tests.rs: dprint-development 0.10.1 -> 0.11.0. This was forced — 0.10.x's run_specs callback signature is anyhow::Result<Option<String>>, which the plugin can no longer produce without keeping anyhow purely for the test harness. 0.11.0 uses Result<Option<String>, Box<dyn std::error::Error + Send + Sync>>, so the spec test just adds .map_err(Into::into).

No behavior changes: all error messages are byte-for-byte identical to before.

dprint_core::formatting::ir_helpers::GeneratedValue gained an is_known_multi_line field in 0.69.0, but this plugin doesn't use the IR, so nothing to do there.

Verification

  • cargo check --all-targets clean
  • cargo test: 18 passed, 0 failed (16 unit, 1 spec test covering 9 sub-specs, 1 doc test)
  • cargo clippy --all-targets: only the two pre-existing warnings (manual arithmetic check, needlessly owned Cow type)
  • Formatted with rustfmt --edition 2024 and dprint fmt

@dsherret dsherret changed the title chore: upgrade to dprint-core 0.69.0 fix(BREAKING): upgrade to dprint-core 0.69.1 and remove anyhow Aug 21, 2026
@dsherret
dsherret merged commit 196904c into main Aug 21, 2026
16 checks passed
@dsherret
dsherret deleted the chore/dprint-core-0.69 branch August 21, 2026 19:36
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