Skip to content

Release v5.2.0

Choose a tag to compare

@github-actions github-actions released this 31 Oct 12:36
c392076

The shared specification lifecycle is now safer to turn on: the analyzers find the facts that change shared state indirectly, so you can tell which classes must stay per fact.

Added

  • New warning CRSPEC0012 reports facts that call members which usually change shared state, judged by name: Execute/Handle (and their Async forms), destructive reads such as Take, Dequeue, Pop and MoveNext, and changes such as Push, Enqueue, TryAdd, Reset, or Add/Remove/Clear on a collection reached through a field. Move the call into Because, or mark the class [PerFactSpecificationLifecycle]. (#97)

Changed

  • CRSPEC0008 now also reports indirect changes it can prove from the code: writes through nested members and indexers (including compound assignment and ++/--), null-conditional access such as _x?.Clear(), Dispose/DisposeAsync on a shared field, reconfiguring a shared NSubstitute substitute (Returns, Throws, When, ClearReceivedCalls), and calls to a method in the same file that does any of these. The message names the method the change goes through. (#97)
  • Upgrade: CRSPEC0008 is an error, so specification projects on the shared lifecycle can get new build errors where a fact really changes shared state. Move the change into Because, or mark the class [PerFactSpecificationLifecycle]. (#97)