Task: https://github.com/solid-software/solid_lints/issues/192

After upgrading solid_lints 0.1.5 ⇒ 0.2.0 the searching of config “analysis_options.yaml” in \test directory was broken, as the result - linter can`t check \test properly and uses global “analysis_options.yaml” from root.

In solid_lints v 0.2.0 :

Spesificaly: in custom_lints 0.6.4 dart analyser was updated to v. ^6.6.0 and package starts to use AnalysisContextCollection (is used in client.dart custom_lint) instead of ContextLocator.

AnalysisContextCollection: https://pub.dev/documentation/xyz_gen/latest/_common/AnalysisContextCollection-class.html

custom_lint changes history:

image.png

image.png

also there __findOptionsForPubspec() and _findRoots() in workspace.dart was added (instead of context locator?) to provide new logic.

ContextLocator was removed from the CustomLintWorkspace. tryFindProjectDirectory() and _findOptionsForPubspeck() were used instead:

image.png

image.png

In versions custom_lint before 0.6.4 there was a mechanism to transform relative path into absolute with creating package_config.json. It was used for plugins search in project, but this approach was removed.

image.png

image.png

computePackageConfig creates files with configs and computes paths.

image.png

The interesting moment is that unreachable_from_main: false was set in that version in custom_lints. But it is ui spesifically, so doesn`t make any interest for us in this context.

image.png

But! With code changes you can see in my commit we can define that test\analysis_options.yaml are analysed, and correct analysis_option.yaml is used. https://github.com/invertase/dart_custom_lint/compare/main...milkyway-12:dart_custom_lint:find-config-file-path

I`ve updated _findRoots method to: