oxidecomputer / progenitor

An OpenAPI client generator
545 stars 69 forks source link

Both normalize_doc_attributes and wrap_comments require an unstable toolchain #843

Open ghost opened 5 months ago

ghost commented 5 months ago

The formatting options used by the cargo install version (https://github.com/oxidecomputer/progenitor/blob/main/cargo-progenitor/src/main.rs#L94) use formatting options that are documented as unstable:

RUST_BACKTRACE=1 cargo progenitor -i api-definition.yml -o output -n output -v 0.1.0
-----------------------------------------------------
 TYPE SPACE
-----------------------------------------------------
....
-----------------------------------------------------

thread 'main' panicked at /Users/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-progenitor-0.7.0/src/main.rs:101:68:
called `Result::unwrap()` on an `Err` value: Unstable("wrap_comments, normalize_doc_attributes")
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: cargo_progenitor::reformat_code
   4: cargo_progenitor::main
ahl commented 5 months ago

Yeah: I'm pretty unhappy with the choice I made here... and with the options available. I'd like to use rustfmt for formatting so that the generated code could pastt cargo fmt... but it's not feasible to use it as a library and shelling out has many problems--including the one you've noted. At this point, I'm inclined to switch everything over to prettyplease and see if that's a better experience. PRs welcome or I'll try to get to it in the next week or two.