Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

DoNotUseTheGreaterThanSign.Analyzer.Net

icon

build NuGet

A Roslyn analyzer that flags > and >= (rule LessThanOnly, warning by default) and a code fix that rewrites them as < and <= by swapping the operands.

a > b          // becomes  b < a
a >= b         // becomes  b <= a
5 > x && x > 2 // becomes  2 < x && x < 5

When an && chain compares one variable against constants, the clauses are also ordered from the smallest constant to the largest. Other code is only flipped, never reordered.

Install: dotnet add package DoNotUseTheGreaterThanSign.Analyzer.Net

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages