-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add support for warnings #18
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to see some movement here. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- removed: if not error['match']
- re.compile moved into init()
- new key error_type used
@@ -17,6 +17,30 @@ class Pyflakes(PythonLinter): | |||
defaults = { | |||
'selector': 'source.python' | |||
} | |||
warning_msg_regex = r'''(?x) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning_msg_regex = r'''(?x) | |
warning_msg_regex = r'''(?x) | |
warning_msg_regex = re.compile(r'''(?x) |
We want to compile exactly once because the regex is static. Doing so in __init__
would still compile per linter run. You can do this either here as a class member or just in the global scope. Anyway, after that overriding __init__
should not be needed anymore.
self.warning_msg_regex = re.compile(self.warning_msg_regex, 0) | ||
|
||
def split_match(self, match): | ||
# mark properly the type error message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the comment as it's clear what we're doing here. The comment is also not a sentence. 😁
Implemented split_match as was suggested by @kaste in #10 an issue started by YonatanAhituv