scarb icon indicating copy to clipboard operation
scarb copied to clipboard

Use incremental cache in linter

Open maciektr opened this issue 4 months ago • 2 comments

The integration for compilation if done here:

  • https://github.com/software-mansion/scarb/blob/e5430c95d1a923006b17cb95a6a55fd12f3caab0/scarb/src/compiler/repository.rs#L59-L61
  • https://github.com/software-mansion/scarb/blob/e5430c95d1a923006b17cb95a6a55fd12f3caab0/scarb/src/compiler/compilers/lib.rs#L67

Do similar integration for linter:

  • https://github.com/software-mansion/scarb/blob/e5430c95d1a923006b17cb95a6a55fd12f3caab0/scarb/src/ops/lint.rs#L182

Note, we may not want to load caches for the linted crates, as lints are calculated as diagnostics - adding caches for deps should be enough.

Please make sure with some quick benchmark, that it works.

maciektr avatar Jul 27 '25 12:07 maciektr

Probably makes sense to do it after https://github.com/software-mansion/scarb/pull/2446/files#r2244998289

maciektr avatar Jul 31 '25 10:07 maciektr

After internal discussion this task is thrown back to backlog. If you consider reopening it familiarise with the discussion in PR ☝️. Other than that, for now we've decided to not proceed with implementation considering:

  • the improvement is negligible
  • Lint does not use lowering group
  • lint does't use diagnostics for dependencies

It may make sense to create custom cache for lint only (cache modules) after it starts to use the diagnostics

FroyaTheHen avatar Sep 08 '25 09:09 FroyaTheHen