ardalis / SmartEnum

A base class for quickly and easily creating strongly typed enum replacements in C#.
MIT License
2.12k stars 164 forks source link

eliminate explicit dependency for STJ on newer frameworks #515

Closed thompson-tomo closed 2 months ago

thompson-tomo commented 3 months ago

Is your feature request related to a problem? Please describe. I want to minimise dependencies in my project by utilising framework dependencies wherever possible

Describe the solution you'd like I want the package to have conditions placed on System.Text.Json so that it can be provided by the framework. Same thing for System.ComponentModel.Annotations

Describe alternatives you've considered Accept the additional dependency

Additional context n/a

ardalis commented 3 months ago

What additional TFM are you looking for? What, specifically, needs to change to fix this issue?

thompson-tomo commented 3 months ago

@ardalis Will submit a pr which will probs be the easiest way to describe it

fiseni commented 2 months ago

Related to dependencies, we should consider this as well. Perhaps as part of another PR, we need to clean and consolidate them.

thompson-tomo commented 2 months ago

@fiseni I have adjusted the condition as suggested and even enabled global package reference for sonar & sourcelink. This meant i needed to add suppressions in.

fiseni commented 2 months ago

Why we're suppressing all these messages? These are all valid suggestions. Example

[SuppressMessage("Minor Code Smell", "S6602:\"Find\" method should be used instead of the \"FirstOrDefault\" extension", Justification = "<Pending>")]
fiseni commented 2 months ago

Now I remember we're treating warnings as errors, right? Ok then, great. We'll tackle all those code smells in the future.

thompson-tomo commented 2 months ago

Correct warnings are being treated as errors & the projects which got suppressions previously didn't have analysis enabled hence the suppression.