A public type is declared inside another public type
What it finds
Callers have to name a nested type through its outer type, Outer.Inner, and most navigation tools hide it. Nested types suit implementation details that are private to the outer type; public ones read better at namespace level. Enums and types nested in static classes are left alone.
From the rule's source, public_nested_type.rs.
public class Parser{ public class Optionstx0 reports: Options is public and nested in Parser { } private class State { } public enum Mode { Fast, }} Turn it on, off or suppress it
The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/csharp:public-nested-type" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/csharp:public-nested-type] reason="..."tx0 explain tx0/csharp:public-nested-type shows the same in the terminal. Found a false positive? Report it.