Skip to content

[spec] Indicate analyzer assets and respect analyzer filtering in project.assets.json#14455

Open
kfikadu wants to merge 8 commits into
devfrom
dev-kfikadu-analyzerAssetsSpec
Open

[spec] Indicate analyzer assets and respect analyzer filtering in project.assets.json#14455
kfikadu wants to merge 8 commits into
devfrom
dev-kfikadu-analyzerAssetsSpec

Conversation

@kfikadu

@kfikadu kfikadu commented Jul 29, 2025

Copy link
Copy Markdown
Contributor

@kfikadu kfikadu self-assigned this Jul 29, 2025
@kfikadu kfikadu requested a review from a team as a code owner July 29, 2025 15:59
@jeffkl jeffkl self-requested a review July 29, 2025 22:36

@nkolev92 nkolev92 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for the delay, great first write-up.
I added some comments about some specifics I'd love to see + some ideas for future possibilities.

Comment thread accepted/2025/indicate-analyzer-assets.md Outdated
Comment thread accepted/2025/indicate-analyzer-assets.md Outdated
Comment thread accepted/2025/indicate-analyzer-assets.md Outdated
Comment thread accepted/2025/indicate-analyzer-assets.md
Comment thread accepted/2025/indicate-analyzer-assets.md
Comment thread accepted/2025/indicate-analyzer-assets.md Outdated
Comment thread accepted/2025/indicate-analyzer-assets.md Outdated
Comment thread accepted/2025/indicate-analyzer-assets.md Outdated
Comment thread accepted/2025/indicate-analyzer-assets.md
@kfikadu kfikadu changed the title Indicate analyzer assets and respect analyzer filtering in project.assets.json [spec] Indicate analyzer assets and respect analyzer filtering in project.assets.json Aug 4, 2025
@kfikadu kfikadu requested a review from nkolev92 August 11, 2025 17:17
Comment thread accepted/2025/indicate-analyzer-assets.md
donnie-msft
donnie-msft previously approved these changes Aug 12, 2025

@donnie-msft donnie-msft left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!
Wondering what you think about renaming EnableIndicateAnalyzerAssets to be more concise, maybe IndicateAnalyzerAssets?

nkolev92
nkolev92 previously approved these changes Aug 13, 2025

@nkolev92 nkolev92 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great.

I may have left some feedback on the spec, but general direction seems fine.
Please go through the feedback and lmk if you have any questions.

Even if this spec is not fully merged yet, I think you can start working on the implementation

Comment thread accepted/2025/indicate-analyzer-assets.md Outdated
Comment thread accepted/2025/indicate-analyzer-assets.md Outdated
Comment thread accepted/2025/indicate-analyzer-assets.md Outdated
Comment thread accepted/2025/indicate-analyzer-assets.md Outdated
Comment thread accepted/2025/indicate-analyzer-assets.md
Comment thread accepted/2025/indicate-analyzer-assets.md
Comment thread accepted/2025/indicate-analyzer-assets.md Outdated
Comment thread accepted/2025/indicate-analyzer-assets.md
Comment thread accepted/2025/indicate-analyzer-assets.md
Comment thread accepted/2025/indicate-analyzer-assets.md

@jeffkl jeffkl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My vote for the property name is RestoreEnableAnalyzerIncludeExcludeAssets

Comment thread accepted/2025/indicate-analyzer-assets.md Outdated
Comment thread accepted/2025/indicate-analyzer-assets.md
Comment thread accepted/2025/indicate-analyzer-assets.md
Comment thread accepted/2025/indicate-analyzer-assets.md
Comment thread accepted/2025/indicate-analyzer-assets.md
Comment thread accepted/2025/indicate-analyzer-assets.md
Comment thread accepted/2025/indicate-analyzer-assets.md
@kfikadu kfikadu dismissed stale reviews from nkolev92 and donnie-msft via 0eb98e0 August 18, 2025 21:32
Comment thread accepted/2025/indicate-analyzer-assets.md Outdated
Comment thread accepted/2025/indicate-analyzer-assets.md Outdated
Comment thread accepted/2025/indicate-analyzer-assets.md Outdated
Comment thread accepted/2025/indicate-analyzer-assets.md Outdated
Comment thread accepted/2025/indicate-analyzer-assets.md Outdated
aortiz-msft
aortiz-msft previously approved these changes Aug 22, 2025
@kfikadu kfikadu requested a review from ericstj August 25, 2025 21:54
@nkolev92 nkolev92 dismissed their stale review September 2, 2025 20:09

There's some feedback from folks around the analyzers folder structure.

@jeffkl jeffkl assigned martinrrm and unassigned kfikadu Sep 9, 2025
@dotnet-policy-service dotnet-policy-service Bot added the Status:No recent activity No recent activity. label Mar 9, 2026
@aortiz-msft aortiz-msft reopened this Apr 29, 2026
@aortiz-msft

Copy link
Copy Markdown
Contributor

@martinrrm - Could you please help understand next steps on this one?

@dotnet-policy-service dotnet-policy-service Bot removed the Status:No recent activity No recent activity. label Apr 29, 2026
@dotnet-policy-service dotnet-policy-service Bot added the Status:No recent activity No recent activity. label May 30, 2026
@martinrrm martinrrm removed the Status:No recent activity No recent activity. label Jun 1, 2026
@martinrrm

Copy link
Copy Markdown
Contributor

Updated the spec and created a PR for Client change NuGet/NuGet.Client#7464 and for SDK change dotnet/sdk#54646.

Comment thread accepted/2025/indicate-analyzer-assets.md Outdated
Comment on lines +38 to +42
|Pattern|Description|
|---|---|
|`analyzers/**/{name}.dll`|Any analyzer assembly, at any depth under `analyzers/`|
|`analyzers/dotnet/{language}/{name}.dll`|Language-specific analyzer (`cs`, `vb`, `fs`)|
|`analyzers/dotnet/{compilerApiVersion}/{language}/{name}.dll`|Analyzer for a specific compiler API version (`roslynX.Y`)|

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the first analyzers/**/{name}.dll pattern exclude the analyzers/dotnet/ directory? If not, what prevents analyzers/dotnet/fs/MyAnalyzer.dll from being used in a C# project?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will add all of the files that start with analyzers/**/{name}.dll, reading this table again it suggests otherwise, but wanted to show that we are gathering language, compilerApiVersion and name from the path and using it in the metadata.

NuGet code won't prevent language selection; this list will be passed to the sdk and the sdk (which currently does) will decide which language to use.

Comment thread accepted/2025/indicate-analyzer-assets.md Outdated
Comment thread accepted/2025/indicate-analyzer-assets.md Outdated
@martinrrm martinrrm requested a review from zivkan June 15, 2026 22:15
Excluded analyzers (for example via `PrivateAssets` or `ExcludeAssets`) are written as a `analyzers/.../_._` placeholder with no metadata.

Examples:
- `analyzers/dotnet/cs/MyAnalyzer.dll` (C# analyzer)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything is analyzers/dotnet/ right?

Do we automatically match dotnet or is somehow configurable?

@jeffkl jeffkl removed their request for review June 18, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

project.assets.json should indicate "analyzer" assets like "compile" and "runtime"