Workbench icon indicating copy to clipboard operation
Workbench copied to clipboard

Lint Rust demos with clippy

Open Hofer-Julian opened this issue 1 year ago • 1 comments

One thing that would be good to have is to check all Rust demos with clippy. Clippy both ensures that they build correctly, but also acts as a linter. Looking at the code it seems like we currently lint with language servers. That is possible with rust-analyzer, but it's also wasteful compared to just running cargo clippy directly.

What I think should be done:

  • Loop through each demo
  • Copy all relevant Rust files into the demo
  • Run cargo clippy (make sure that target dir is set correctly)
  • Remove copied Rust files again

Hofer-Julian avatar Feb 15 '24 08:02 Hofer-Julian

The reason we use the LSP to lint is to guarantee 100% compat with Workbench.

It prevents shipping demos that have errors or warnings once users open them in Workbench. Think of it as headless Workbench.

Eventually we might even open a full Workbench session for each single demo anyway in order to do UI automation tests and screenshot tests.

sonnyp avatar Feb 15 '24 16:02 sonnyp