Skip to content
Mark edited this page May 9, 2024 · 16 revisions

Current Rules

id title
WTG1001 Do not use the 'private' keyword.
WTG1002 Use the 'var' keyword instead of an explicit type where possible.
WTG1003 Do not leave whitespace on the end of the line.
WTG1004 Indent with tabs rather than spaces.
WTG1005 Use consistent line endings.
WTG1006 Do not use the 'internal' keyword for non-nested type definitions.
WTG1007 Do not compare bool to a constant value.
WTG1008 Do not compare bool to a constant value in an expression.
WTG1009 Using directives must be ordered by kind.
WTG1010 Use the 'var' keyword instead of an explicit type where possible.
WTG1011 Use the 'var' keyword once when deconstructing an object.
WTG1012 Use the 'var' keyword instead of an explicit type where possible.
WTG1013 Don't use tuple types in public interfaces.
WTG1014 Don't nest conditional operators.
WTG1015 Conditional operators should not have multiline values.
WTG1016 Avoid the discard-coalesce-throw pattern.
WTG1017 Don't define variables that could be confused with discards.
WTG1018 Boolean literals as method arguments should be passed as named arguments.
WTG2001 Do not use ConfigureAwait from an async void method.
WTG2002 Avoid conditional compilation based on DEBUG.
WTG2003 Flags enums should specify explicit values.
WTG2004 Do not use Code Contracts.
WTG2005 Use Correct Emit Overload.
WTG2006 Do not pass the Compiled option into static methods on Regex.
WTG2007 Do not use custom values for the Reason Phrase portion of a HTTP response.
WTG2008 Do not specify path separators in string literals that represent filesystem paths.
WTG2009 Do not use MSBuildLocator.RegisterDefaults().
WTG3001 Remove orphaned suppressions.
WTG3002 Prefer direct member access over linq.
WTG3003 Prefer direct member access over linq in an expression.
WTG3004 Prefer Array.Empty<T>() over creating a new empty array.
WTG3005 Don't call ToString() on a string.
WTG3006 Prefer nameof over calling ToString on an enum literal.
WTG3007 Overrides should not simply call base.
WTG3008 Do not compare value types with null.
WTG3009 Prefer Task.CompletedTask when applicable.
WTG3010 Don't await trivially completed tasks.
WTG3011 Don't mutate string arguments appended to a string builder.
WTG3012 Avoid combining bool literals in larger boolean expressions.
WTG3013 Don't use Concat() when appending a single element to enumerables.
WTG3014 Don't use Concat() when prepending a single element to enumerables.
WTG3015 Don't concat two collections defined with literals.
WTG3016 Interpolated string must be purposeful, ie contain interpolated elements.
WTG3101 Do not nest regions.
WTG3102 Regions should not split structures.
WTG3103 Conditional compilation directives should not split structures.
WTG4001 Using Enumerable Extension Methods on a Queryable.
Clone this wiki locally