AvaloniaUI / avalonia-dotnet-templates

Avalonia Templates for `dotnet new`
MIT License
514 stars 89 forks source link

Fixes Code Analysis issues for C# templates #229

Closed curia-damiano closed 1 year ago

curia-damiano commented 1 year ago

In my project I have enabled code analysis and found a couple of issues. I would like to contribute updating the templates to benefit everyone.

Takoooooo commented 1 year ago

I guess these problems apply to F# templates too,may you add these fixes for them also?

curia-damiano commented 1 year ago

I'm sorry but I really don't know F#...

Mrxx99 commented 1 year ago

I don't think waring suppressions should be in code, that just adds noise and most don't use analyzers that report these. What could maybe make sense is to set the "mark members as static" as ignored in the csproj. As this almost always reports wrongly on ViewModels

Mrxx99 commented 1 year ago

There are also some indentation changes that look wrong

Takoooooo commented 1 year ago

Generally i am ok with everything besides identation changes,can they be reverted? I will add these changes to F# templates after that

curia-damiano commented 1 year ago

sorry I use tabs on my machine. I will work on this later

curia-damiano commented 1 year ago

About the Gretting variable, another option is to make it static, but probably this would change the meaning of the view model.

Or it can returns some non-static string

Takoooooo commented 1 year ago

@curia-damiano ping

curia-damiano commented 1 year ago

I've fixed the formatting