arcade icon indicating copy to clipboard operation
arcade copied to clipboard

Possible incorrect use of "NOT ... OR ..." pattern

Open GrabYourPitchforks opened this issue 1 month ago • 1 comments

Our internal tools are flagging these blocks of code as potentially improper use of the not ... or ... pattern matching syntax.

https://github.com/dotnet/arcade/blob/23d431613e20b20517334c1acbc7a04a6edb6ad9/src/Microsoft.DotNet.Build.Tasks.Feed/src/PublishArtifactsInManifestBase.cs#L757

See https://github.com/dotnet/roslyn/issues/75506 for more information on why this pattern is being flagged. If this logic is correct, consider restructuring it to use clarifying () parentheses.

GrabYourPitchforks avatar Nov 21 '25 21:11 GrabYourPitchforks

Yeah, this is solidly wrong. Would be x is not null and x is not "". Better to use !string.IsNullOrEmpty(x).

mmitche avatar Nov 24 '25 19:11 mmitche