Open GregoryConrad opened 1 day ago
Summary: The issue proposes a new lint rule that flags top-level final
and const
variables without explicit type declarations. This rule aims to improve code readability by encouraging explicit type annotations, especially for complex types.
This would be a nice-to-have opt-in lint. Can helpful when handling more complex types.
Rationale: increases code readability (especially for code reviews, when you don't have an IDE handy) by having type information specified explicitly in the source code. While it is sometimes obvious (like in the case of the
const int i = 0
above), it is fairly useful when dealing with non-obvious types.