TLDR: Adding #![warn(clippy::foo)] or #![deny(clippy::foo)] to a module will soon generate warnings or errors during fx build without needing to run fx clippy on its own. The deny_warnings GN arg will work the same for Clippy lints as it does for rustc lints.
Earlier this year, the Rust on Fuchsia team enabled Clippy in our build so that lint warnings would appear in Tricium/CQ. Many thanks to Joseph Ryan for all the work he put in to make it possible! Since then, it has been possible to add lint-enabling attributes to Rust crates so that they could be surfaced during code review, but reproducing the warnings locally required running a separate command, fx clippy. This worked well to smoothly roll out support without disrupting anyone's workflows while still being able to choose certain lints that would always produce errors.
As part of an effort to improve reliability in Component Manager the CF team is considering opting its code into a stricter set of lints, but we expect it would be awkward to have a workflow where developers either must run a separate command from fx build to see the errors or only discover them when uploading a CL and running it through infra. Addressing this awkwardness requires running Clippy lints by default in builds, and ensuring that they behave consistently with other warnings/errors that are configured in source code the same way. In turn, running Clippy in the build by default requires that any existing lint violations are resolved or suppressed.
Today I'm going to land a CL which addresses all existing lint violations, either by running rustfix, fixing the easy ones manually, or adding an #[allow(...)] attribute. In the coming days I'll land a follow-up that actually flips the flags to include Clippy in builds by default. Once that's done I'll reply to this thread to notify anyone interested, which will probably be a good time to double check the lint configuration for any crates you own.
After these changes, Clippy warnings should still appear in Tricium for faster feedback. Please file a bug against the Rust>tools>clippy component and ping me and Joseph Ryan if you encounter any issues.
Thanks!
Adam Perry on behalf of the Rust on Fuchsia Working Group