You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It isn't currently possible to pass colcon test on a cargo package which doesn't conform to cargo fmt. Although I certainly think that declaring and aligning with a standard code formatter is probably a good idea, I don't think it should be something we should force package developers to do.
In other colcon packages we optionally add extra functionality during the test job by looking at the dependencies the package has declared. For example, if a package has a dependency on pytest-cov, we automatically enable code coverage. Unfortunately I don't see a way to do that here. I thought that maybe we could add rustfmt to the dev-dependencies if we wanted to enable the format check, but as I understand it, the crate dependencies are exclusively for libraries so it isn't appropriate (or possible?) to use dev-dependencies for this.
The best I can come up with is that we should only implicitly run cargo fmt if we find a rustfmt.toml or .rustfmt.toml in any directories up the tree, following the behavior of rustfmt itself for configuration discovery. If a developer wants to implicitly enable cargo fmt for all packages in their workspace, they can place an empty rustfmt config file in their workspace.
Hoping for feedback from rust developers on this.
The text was updated successfully, but these errors were encountered:
It isn't currently possible to pass
colcon test
on a cargo package which doesn't conform tocargo fmt
. Although I certainly think that declaring and aligning with a standard code formatter is probably a good idea, I don't think it should be something we should force package developers to do.In other colcon packages we optionally add extra functionality during the test job by looking at the dependencies the package has declared. For example, if a package has a dependency on
pytest-cov
, we automatically enable code coverage. Unfortunately I don't see a way to do that here. I thought that maybe we could addrustfmt
to thedev-dependencies
if we wanted to enable the format check, but as I understand it, the crate dependencies are exclusively for libraries so it isn't appropriate (or possible?) to usedev-dependencies
for this.The best I can come up with is that we should only implicitly run
cargo fmt
if we find arustfmt.toml
or.rustfmt.toml
in any directories up the tree, following the behavior ofrustfmt
itself for configuration discovery. If a developer wants to implicitly enablecargo fmt
for all packages in their workspace, they can place an empty rustfmt config file in their workspace.Hoping for feedback from rust developers on this.
The text was updated successfully, but these errors were encountered: