Use incremental cache in linter
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.
Probably makes sense to do it after https://github.com/software-mansion/scarb/pull/2446/files#r2244998289
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