oxidecomputer / oxidecomputer/progenitor

Both normalize_doc_attributes and wrap_comments require an unstable toolchain

Open
#843 4 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1k
Forks
136
Avg merge
8h 36m
Merged PRs (30d)
14

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in cargo-progenitor/src/main.rs around the formatting options at line 94 and reformat_code near line 101. Reproduce the failure with the cargo progenitor command shown in the issue using a stable toolchain, then trace how the unstable options are applied. Done means the command no longer panics because of normalize_doc_attributes or wrap_comments and generated output remains formatted.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.