subcommand to lint format of Cargo file
and an option for all commands to fail early if format is invalid
I have not found an actual usecase to justify this
but have been learning rust and maybe this will be useful for noobs to double-check
the smallest valid Cargo.toml file is
[package]
name = "hello_world"
version = "0.0.1"
authors = [ "name <email@example.com>" ]
now let us say we leave out the name.
cargo build will throw an error
failed to parse manifest at `/src/hello-rust/Cargo.toml`
Caused by:
expected a value of type `string` for the key `package.name`
will throw a warning for unused keys as well
[package]
name = "hello_world"
version = "0.0.1"
users = [ "name <email@example.com>" ]
warning "unused manifest key: package.users"
but exit status is zero and everything works
also no error is thrown for an unused section. example:
[package]
name = "hello_world"
version = "0.0.1"
authors = [ "Deepak Kannan <kannan.deepak@gmail.com>" ]
[dependency]
should have been dependencies rather than dependency above
PS: I have been using cargo build for all these examples.
but am not sure, if the config is checked for unused params by each sub-command
subcommand to lint format of Cargo file
and an option for all commands to fail early if format is invalid
I have not found an actual usecase to justify this
but have been learning rust and maybe this will be useful for noobs to double-check
the smallest valid
Cargo.tomlfile isnow let us say we leave out the name.
cargo buildwill throw an errorwill throw a warning for unused keys as well
warning "unused manifest key: package.users"
but exit status is zero and everything works
also no error is thrown for an unused section. example:
should have been
dependenciesrather thandependencyabovePS: I have been using
cargo buildfor all these examples.but am not sure, if the config is checked for unused params by each sub-command