Skip to content

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

Merged
martinrrm merged 8 commits into
devfrom
dev-kfikadu-analyzerAssetsSpec
Aug 3, 2026
Merged

martinrrm merged 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.

@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
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

@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

@kfikadu
kfikadu dismissed stale reviews from nkolev92 and donnie-msft via 0eb98e0 August 18, 2025 21:32
aortiz-msft
aortiz-msft previously approved these changes Aug 22, 2025
@kfikadu
kfikadu requested a review from ericstj August 25, 2025 21:54
@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 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.

@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
@dotnet-policy-service dotnet-policy-service Bot added the Status:No recent activity No recent activity. label Jul 31, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has no activity for 30 days. It will be closed if no further activity occurs within another 15 days of this comment, unless it has a "Status:Do not auto close" label. If it is closed, you may reopen it anytime when you're ready again, as long as you don't delete the branch.

@martinrrm
martinrrm merged commit 9af8119 into dev Aug 3, 2026
1 check passed
@martinrrm
martinrrm deleted the dev-kfikadu-analyzerAssetsSpec branch August 3, 2026 22:00
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"