-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rxg include '\p{Han}' will throw error #7202
Comments
This doesn't seem like it is a
|
I think this could be improved! Similar to the helpful output when passing an unrecognized option to Pylint, we could give a friendly output indicating that the regex pattern is invalid without the traceback; happy to put a MR together if you agree. |
Thanks @mbyrnepr2 I did not even realize it was a crash that we had to fix before your comment. |
@mbyrnepr2 I think in the above stacktrace on line 1858 makes the most sense. We need to decide though if we continue to run the program. I think it makes sense to still quit. If we catch regex errors there and pass we will also "allow" ignore path regexes that don't work. I don't think we should do that. Imo, incorrect regexes are a little different from other "incorrect" options, since there is little risk that they are valid on other interpreters or versions such as old messages etc. Therefore, I'd prefer to (cleanly) exit. |
Indeed @DanielNoord I think we are on the same page regarding this point; I would also exit instead of passing if the regex is invalid. That line you mention, we can basically try/except on re.error and exit printing the details of the pattern which is invalid. |
Closes #7202 * Apply the regex validation to comma-separated regular expression option values. Co-authored-by: Pierre Sassoulas <[email protected]>
Bug description
config rxg in pylintrc with \p{Han} will throw err
Configuration
.pylintrc:
function-rgx=[\p{Han}a-z_][\p{Han}a-z0-9_]{2,30}$
Command used
Pylint output
Expected behavior
not throw error
Pylint version
OS / Environment
macOS 11.6.7
The text was updated successfully, but these errors were encountered: