How to migrate codebase to strict mode gradually?

47 views Asked by At

Recently I joined project with low quality codebase and I want to set analyzer to strong-mode and set a bunch of strict linter rules. But when I did that, I get more than 3K errors.

I can't rewrite all codebase at once.

Is there is a way to set new strict analyzer options only for new code and code that was edited?

Maybe something like second analyzer_options_strict.yaml file with applyOnlyTo/exclude: [filenames] option.

How to migrate all codebase to strict mode gradually in the right way?

1

There are 1 answers

0
Ivo Fernandes On

If you are picking an old project that is a monolith, a nice first step is to divide into multiple packages, that way you can fine each one part by part and evolve the analyzer in a step by step way