dotnet / aspire

An opinionated, cloud ready stack for building observable, production ready, distributed applications in .NET
https://learn.microsoft.com/dotnet/aspire
MIT License
3.45k stars 365 forks source link

Add Aspire related analyzers for improved developer experience #1209

Open timheuer opened 7 months ago

timheuer commented 7 months ago

There are likely patterns that are emerging here, especially in AppHost scenario, that could benefit from a set of code analyzers to warn/enforce/fix some of them. For example in #1202 an analyzer could have produced a squiggle + build warning alerting me to a conflict.

image

mitchdenny commented 6 months ago

Setting the first analyzer size to medium because we'll need to setup the infrastructure in the repo.

DamianEdwards commented 6 months ago

Another potential analyzer: Validate the .csproj path passed to AddProject exists (although this might violate the "don't do I/O from analyzers" rule).

drewnoakes commented 6 months ago

Another analyzer: Provide early feedback about invalid resource names (per recent validation logic).

danmoseley commented 4 months ago

I suggest moving this to the GA or later milestones as it can be out of band, and we are almost complete. Anyone see differently?

danmoseley commented 4 months ago

moving to backlog

DamianEdwards commented 1 month ago

FYI I have a branch adding the required infrastructure and the first analyzer (invalid resource/endpoint names) at https://github.com/dotnet/aspire/tree/damianedwards/model-name-analyzer. Hope to send a PR soon.