Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CP] Fix analysis_options.yaml "include:" for nested folders in workspace. #56464

Closed
keertip opened this issue Aug 13, 2024 · 1 comment
Closed
Assignees
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. cherry-pick-approved Label for approved cherrypick request cherry-pick-merged Cherry-pick has been merged to the stable or beta branch. cherry-pick-review Issue that need cherry pick triage to approve type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@keertip
Copy link
Contributor

keertip commented Aug 13, 2024

Commit(s) to merge

https://dart-review.googlesource.com/c/sdk/+/376500

Target

stable

Prepared changelist for beta/stable

https://dart-review.googlesource.com/c/sdk/+/380205

Issue Description

When folders/package are nested in a workspace, and the analysis_options.yaml has an include: that depends on the other package, the include: does not get resolved. This fix allows for nested folders to be separate workspaces with packages. This fixes an issue that was introduced with the changes for monorepo support.

What is the fix

The analyzer maintains a map of all known workspaces and their roots, and this is built by traversing the directory structure. The fix ensures that all nested roots were added to the map before any lookup is done.

Why cherry-pick

Since the include: in the analysis options cannot be resolved, the analysis performed can report errors/warnings that should be reported, and vice versa. This leads to a poor UX and makes it difficult to code, as now the user cannot rely on the analysis results.

Risk

Low risk.

Issue link(s)

#56047

Extra Info

No response

@keertip keertip added the cherry-pick-review Issue that need cherry pick triage to approve label Aug 13, 2024
@dart-github-bot
Copy link
Collaborator

Summary: The include: directive in analysis_options.yaml fails to resolve nested packages within a workspace, leading to incorrect analysis results. This fix ensures that all nested workspaces are properly registered, enabling accurate analysis of nested packages.

@dart-github-bot dart-github-bot added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Aug 13, 2024
@itsjustkevin itsjustkevin added cherry-pick-approved Label for approved cherrypick request cherry-pick-merged Cherry-pick has been merged to the stable or beta branch. labels Aug 13, 2024
@lrhn lrhn removed the triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. label Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. cherry-pick-approved Label for approved cherrypick request cherry-pick-merged Cherry-pick has been merged to the stable or beta branch. cherry-pick-review Issue that need cherry pick triage to approve type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

7 participants