Skip to content

Support cargo workspace inheritance#98

Open
ya7010 wants to merge 2 commits intowebern:mainfrom
ya7010:support_cargo_toml
Open

Support cargo workspace inheritance#98
ya7010 wants to merge 2 commits intowebern:mainfrom
ya7010:support_cargo_toml

Conversation

@ya7010
Copy link
Copy Markdown

@ya7010 ya7010 commented Jan 8, 2024

Related #81.

I rewrite using cargo_toml crate for workspace inheritance.

Comment thread src/config/badges.rs Outdated
pub fn github(badge: cargo_toml::Badge) -> String {
let repo = badge.repository;
// TODO: support workflow option.
let workflow = "main"; // BADGE_WORKFLOW_DEFAULT
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a problem. cargo_toml does not support [badge.github] field.

But badge section is deprecated, so I am hesitant to make a PR to cargo_toml.

Copy link
Copy Markdown

@Freyskeyd Freyskeyd Mar 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The badge should be removed from cargo-readme following cargo_toml recommandation.
The badges, if the maintainer want them, should be placed into a template (README.tpl) like that:

# {{crate}}

![Test workflow](https://github.com/topos-protocol/topos/actions/workflows/test.yml/badge.svg)
![Quality workflow](https://github.com/topos-protocol/topos/actions/workflows/quality.yml/badge.svg)
![MSRV](https://img.shields.io/badge/MSRV-1.71.1-blue?labelColor=1C2C2E&logo=Rust)

{{readme}}

@webern what do you think of this solution? I think it should considered as breaking change tho

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me. Fewer things for this code to worry about.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@webern

Are there any modifications I can make to this PR?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there is anything you can do without breaking

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

What can I do to merge this PR?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,

For this PR I would completely remove the badges from the generation and update the doc to explain how to add them in the README.tpl, it is a breaking but I don't see another alternative. WDYT?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good.

The Cargo.toml spec is changing and badges are already deprecated.

@ya7010 ya7010 changed the title Support cargo workspace Support cargo workspace inheritance Jan 8, 2024
@ya7010 ya7010 requested a review from webern April 3, 2024 03:49
@ya7010 ya7010 requested a review from Freyskeyd October 14, 2024 01:28
@cmrschwarz
Copy link
Copy Markdown

Any updates on this? I would love to see this landing.

@ya7010
Copy link
Copy Markdown
Author

ya7010 commented Jan 7, 2025

@webern

Really waiting for the merge and release of this PR.

Is there anything else I can do?

@TobiasGrothmann
Copy link
Copy Markdown

Just had this issue myself. I'd love to see this merged.

@fenollp
Copy link
Copy Markdown

fenollp commented Oct 14, 2025

This PR works for me. Installed with

cargo install --locked cargo-readme --git https://github.com/ya7010/cargo-readme.git --branch support_cargo_toml

@webern webern force-pushed the support_cargo_toml branch from 66e0176 to 5fdc785 Compare April 9, 2026 21:41
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.

6 participants