-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Current problem
pylint only allows message id's up to 9999 since we are limiting ourselves to four digit id's.
If we are going to limit each 2 digit prefix to an individual checker and keep the 51-99 prefixes for external plugins we might run out of prefixes. Therefore, we should probably increase the max length to be 5 digits.
For reference:
Another thing, if each checker gets its own prefix, we are essential limited to
100. That might work for us, but what aboutplugins? Should we consider 5 digits? For existing checks, we could add a leading0. We need to keep in mind though that is might also be a breaking change. So I suggest3.0for it, too.
Originally posted by @cdce8p in #5255 (comment)
Desired solution
We will need to find a good way to resolve the current id's to follow the new scheme.
I think we can still consider the last two digits to be specific to each message while the first three digits can be considered the prefix. If a checker handles 99+ messages it might be time to separate it into a new class for easier maintainability, so limiting each checker to 99 messages should be fine.
Then we need a way to resolve the messages which currently have prefixes 1-50 and 51-99. There are two options:
- keep accepting four digit
id's and append a leading zero when we encounter them or - force extension maintainers (and ourselves) to add the leading zero and only accept five digit
id's.
Option 2 obviously has the benefit that it will be much easier to maintain and I think would only require minimal work from maintainers, they can just do find all + replace. However, for users that are disabling based on id's this might become more problematic. However, I wonder how large the group of users is that is upgrading to semversion breaking changes and is using id's for disables. The docs are quite clear about preferring message names for disables.
A second thing to discuss is which prefixes we will reserve for external plugins. Again, I see two options:
A. 1-500 for pylint and 501-999 for plugins
B. 1-50 for pylint and 51-99 for plugins, 100-150 for pylint and 151-199 for plugins, etc.
Here I think the option A might be best, as it is more in line with the current division.
Additional context
No response