Skip to content

Add check-features command#19

Closed
koenw wants to merge 2 commits intoparitytech:masterfrom
koenw:check_features
Closed

Add check-features command#19
koenw wants to merge 2 commits intoparitytech:masterfrom
koenw:check_features

Conversation

@koenw
Copy link

@koenw koenw commented Jun 22, 2022

The check-features subcommand checks all Cargo.toml files in a given folder for dependencies that have default-features = false but are not part of the std feature.

This functionality was originally requested in Opstooling #55 and further discussed in Substrate #11715.

In order to facilitate these changes I've also updated the cargo_edit dependency.

koenw added 2 commits June 23, 2022 00:44
The `check-features` subcommand checks all `Cargo.toml` files in a given
folder for dependencies that have `default-features = false` but are not
part of the `std` feature.
@ggwpez
Copy link
Member

ggwpez commented Oct 7, 2022

Is there a reason for parsing Cargo.toml files instead of using cargo metadata? It outputs JSON and should also work for external dependencies:

"dependencies": [
{
  "name": "lazy_static",
  …
  "optional": true,
  "uses_default_features": true,
  "features": [],
  …
},
…

and then whether or not it is enabled in the features:

"features": {
  "default": [
    "heavyweight"
  ]

So it even tells you if the std feature exists for the dependency.

@koenw
Copy link
Author

koenw commented Oct 12, 2022

I guess that would work too, but I'm not working on this anymore so I haven't really thought about it.

@chevdor
Copy link
Contributor

chevdor commented Jul 24, 2023

@koenw do you plan on keeping your work on this PR or shall we close it ?

@koenw
Copy link
Author

koenw commented Jul 25, 2023

@chevdor I do not plan to work on this PR, feel free to close.

@chevdor
Copy link
Contributor

chevdor commented Jul 25, 2023

I still like the idea, we can reopen this later if bandwidth allows.

@chevdor chevdor closed this Jul 25, 2023
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.

3 participants