madelson / DistributedLock

A .NET library for distributed synchronization
MIT License
1.74k stars 182 forks source link

Install NUnit.Analyzers 4.1.0 and follow all suggested autofixes #203

Closed Bartleby2718 closed 2 months ago

Bartleby2718 commented 3 months ago

This PR closes #202.

Steps taken:

  1. Install NUnit.Analyzers 4.1.0 through VS 2022's built-in NuGet Package Manager.
  2. Build the solution. This caused build warnings like:
  3. For each warning, click it to get to the code and implement the suggested automatic fix in the entire solution.
  4. If the automatic fix causes a build failure, fix it manually. (There were only a couple, I think: https://github.com/nunit/nunit.analyzers/issues/712, https://github.com/nunit/nunit.analyzers/issues/713)
  5. Tried updating nunit to the latest version 4.1.0 and noticed that there were some NUnit diagnostics whose severities were not warnings. (I didn't realize there were non-warning diagnostics, but in retrospect, I should've updated .editorconfig to set the severity to warning or above for all ClassicAssert-related diagnostics in https://docs.nunit.org/articles/nunit-analyzers/NUnit-Analyzers.html. Also, I didn't realize the CodeGen project had NUnit installed, so I installed NUnit.Analzyers there as well.)