language-formatters-pre-commit-hooks icon indicating copy to clipboard operation
language-formatters-pre-commit-hooks copied to clipboard

Rust: add support to non-root folder Config.toml

Open AJIOB opened this issue 1 year ago • 1 comments
trafficstars

cargo fmt has support to --manifest-path argument, that can be used for passing Config.toml location.

It can be used in this way: cargo fmt --manifest-path my/subdir/Cargo.toml -- --check.

It is useful when your repository contains Cargo.toml in the non-root location.

AJIOB avatar Jan 16 '24 11:01 AJIOB

@AJIOB thanks for the report. PRs are welcome, feel free to open one and I'll be happy to review.

Via a quick search I've found out https://github.com/rust-lang/cargo/issues/7856, please make sure that the behaviour is as you expect.

About a possible guidance, I would add an optional parameter (defaulted to Cargo.toml) in the pretty-format-rust such the change will not be a breaking one, while allowing extension to provide customers to customise the manifest file

macisamuele avatar Jan 16 '24 11:01 macisamuele