Linux command
cargo-verify-project 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Verify current project manifest
cargo verify-project
Verify specific manifest
cargo verify-project --manifest-path [path/to/Cargo.toml]
Verify with locked dependencies
cargo verify-project --locked
Verify offline
cargo verify-project --frozen
说明
cargo verify-project parses and validates the local Cargo.toml manifest file. It outputs a JSON object indicating whether the manifest is syntactically correct and contains all required fields, along with error details on failure. This command is useful in CI/CD pipelines and pre-commit hooks for catching manifest errors early. It checks syntax correctness, valid dependency specifications, proper metadata formatting, and required fields. It does not verify that dependencies actually exist on a registry, only that the manifest itself is well-formed. The exit status is 0 for valid manifests and 1 for invalid ones.
参数
- --manifest-path _path_
- Path to Cargo.toml file.
- --locked
- Assert that Cargo.lock is up-to-date.
- --frozen
- Assert that Cargo.lock is up-to-date and prevent network access.
- --offline
- Run without accessing the network.
- -v, --verbose
- Use verbose output.
- -q, --quiet
- Suppress cargo output messages.
- --config _KEY=VALUE_
- Override a Cargo configuration value.
- -C _path_
- Change to directory before executing.
FAQ
What is the cargo-verify-project command used for?
cargo verify-project parses and validates the local Cargo.toml manifest file. It outputs a JSON object indicating whether the manifest is syntactically correct and contains all required fields, along with error details on failure. This command is useful in CI/CD pipelines and pre-commit hooks for catching manifest errors early. It checks syntax correctness, valid dependency specifications, proper metadata formatting, and required fields. It does not verify that dependencies actually exist on a registry, only that the manifest itself is well-formed. The exit status is 0 for valid manifests and 1 for invalid ones.
How do I run a basic cargo-verify-project example?
Run `cargo verify-project` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --manifest-path _path_ do in cargo-verify-project?
Path to Cargo.toml file.