Skip to content

Conversation

gorkicode
Copy link

Implemented split_match as was suggested by @kaste in #10 an issue started by YonatanAhituv

  • Added support for warnings

Copy link
Member

@kaste kaste left a 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. 👍

Copy link
Author

@gorkicode gorkicode left a 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

@gorkicode gorkicode marked this pull request as draft November 18, 2021 00:34
defaults = {
'selector': 'source.python'
}
warning_msg_regex = r'''(?x)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Member

@kaste kaste Nov 18, 2021

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. 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants