SharedInfrastructure icon indicating copy to clipboard operation
SharedInfrastructure copied to clipboard

NRT

Open stefannikolei opened this issue 3 years ago • 2 comments

Contains work for https://github.com/SixLabors/ImageSharp/pull/2236

stefannikolei avatar Sep 20 '22 11:09 stefannikolei

Codecov Report

Merging #34 (28bfbea) into main (bf398a9) will decrease coverage by 0%. The diff coverage is 14%.

@@        Coverage Diff         @@
##           main   #34   +/-   ##
==================================
- Coverage    20%   19%   -1%     
==================================
  Files         4     4           
  Lines       352   346    -6     
  Branches     88    85    -3     
==================================
- Hits         71    68    -3     
+ Misses      281   278    -3     
Flag Coverage Δ
unittests 19% <14%> (-1%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/SharedInfrastructure/DebugGuard.cs 43% <0%> (+1%) :arrow_up:
src/SharedInfrastructure/ThrowHelper.cs 92% <ø> (-1%) :arrow_down:
src/SharedInfrastructure/Guard.cs 44% <100%> (-2%) :arrow_down:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Sep 20 '22 11:09 codecov[bot]

@JimBobSquarePants I think this needs to be merged first. After this changes are in the repo my PR with nullable changes should hopefully compile. (IT works on my machine ;) )

stefannikolei avatar Sep 21 '22 14:09 stefannikolei

@JimBobSquarePants This could be the next step for NRT. When this annotations make it to the main Repo, some NRT Errors will disappear.

But because of the Conditional Attribute the ArgumentNullException will not be thrown in Release builds. Is this intended?

stefannikolei avatar Dec 18 '22 11:12 stefannikolei

I’m not sure I understand your question? We have to guard classes. Guard and DebugGuard the latter designed for debugging only.

JimBobSquarePants avatar Dec 18 '22 12:12 JimBobSquarePants

The DebugGuard will only execute while Debugging. So in release mode the method will not be executed and no ArgumentNullException will be thrown. Perhaps a NullReferenceException when the value is used which was passed to the DebugGuard.

Perhaps after finishing NRT the DebugGuard.NotNull can be removed because everything is "hopefully" save ;)

stefannikolei avatar Dec 18 '22 12:12 stefannikolei

That’s by design. We don’t want DebugGuard running in release mode.

Yeah agreed. It’s likely with the proper nullable fixes we won’t even require it.

JimBobSquarePants avatar Dec 18 '22 21:12 JimBobSquarePants