Open Pierre-Sassoulas opened 2 years ago
It would be great if the error messages could get more specific when necessary. For example, if a variable named ThingType
is detected, it should explicitly tell the user that the Type
suffix is forbidden.
An improved error message would indeed be very helpful, especially since this is a bit contentious and a strict convention. I just hit upon this today, as it's quite natural to suffix with Type
to distinguish it from a real type.
Current problem
We're getting a lot of report for the new TypeVar naming style lately (#6050, #6003). It's probably annoying users. We took a decision but it's not conveyed in the warning message. We also have a long standing issue with snake_case requiring to be more than 3 letters and less than 30 characters long but not explaining it properly (the regex behind it is also hidden).
Desired solution
We could replace
doesn't conform to predefined naming style
by ``is not in snake_case and between 3 and 30 char long" by adding a description attribute to NameStyle. It's a lot easier to do than to actually refactor the checker to separate length and name style.Additional context
2018