TimonPost / cargo-unused-features

Find potential unused enabled feature flags and prune them.
MIT License
230 stars 10 forks source link

Supporting workspace versioning #7

Closed max-sixty closed 1 year ago

max-sixty commented 1 year ago

Describe the bug Does this crate support workspace versioning? I'm getting an error when attempting to run it on prql-compiler. Here's the issue template:

❯ unused-features analyze --log-level debug
[2022-12-09T00:21:11Z INFO  unused_features::subcommands::analyze] /Users/maximilian/workspace/prql/prql-compiler
[2022-12-09T00:21:11Z DEBUG unused_features::cargo_project] Loading '/Users/maximilian/workspace/prql/prql-compiler/Cargo.toml' ...
[2022-12-09T00:21:11Z DEBUG unused_features::cargo_project] Successfully read the toml file.
[2022-12-09T00:21:11Z DEBUG unused_features::cargo_project] Parsing toml definition ...
[2022-12-09T00:21:11Z ERROR unused_features::subcommands::analyze] Failed to load '/Users/maximilian/workspace/prql/prql-compiler/Cargo.toml' crate. invalid type: map, expected a string for key `package.version` at line 8 column 21
[2022-12-09T00:21:11Z INFO  unused_features] Finished the process

Thank you!

TimonPost commented 1 year ago

I am using those libs to do the analyzing of the crate:

cargo_toml= { version="0.11.5", default-features = false } toml= { version="0.5.9", default-features = false } serde= { version="1.0", default-features = false } toml_edit = { version = "0.14.4", default-features = false }

So depends a bit if they support it and how new the feature is

max-sixty commented 1 year ago

cargo_toml looks well maintained, and 0.11.5 is nine months old, so my guess is that bumping that will fix it...

jayvdb commented 1 year ago

I was able to workaround this by bumping a few deps, and updating a few bits of code. Some of my changes are inadequate, but I will put up a PR anyway.