-
Notifications
You must be signed in to change notification settings - Fork 24
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
upgrade salt-pylint to work with pylint 3.0.3 #49
Conversation
Current saltpylint works with pylint==2.13.9. It does not work with newer versions of pylint such as 2.17 ... 3.0.3. Pylint 3.0.3 includes many code changes, such as remove exposed checker interfaces, remove some @utils fucitons, remove checker member functions (config) .. The submitted pr removes those disappeared functions. Review is required to make sure it does not remove necessary checks as a result. This commit will fix issues - saltstack#48 - saltstack#47
@s0undt3ch would you mind having a look please? =) |
|
||
def open(self): | ||
super(ThirdPartyImportsChecker, self).open() | ||
self.cwd = os.getcwd() | ||
self.allowed_3rd_party_modules = set(self.config.allowed_3rd_party_modules) # pylint: disable=no-member |
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.
Why don't we want a set?
The set would remove duplicates
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.
i add it back in
saltpylint/strings.py
Outdated
@@ -151,8 +134,7 @@ def visit_call(self, node): | |||
) | |||
|
|||
if BAD_FORMATTING_SLOT.findall(inferred.value): | |||
if self.config.un_indexed_curly_braces_always_error or \ | |||
sys.version_info[:2] < (2, 7): | |||
if sys.version_info[:2] < (2, 7): |
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.
Any Py2 code or logic can just be removed
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 and add back in un_indexed_curly_braces_always_error check
saltpylint/strings.py
Outdated
msgid = 'E1321' | ||
else: | ||
msgid = 'W1321' | ||
msgid = 'W1321' |
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.
Why are we no longer caring for string_substitutions_usage_is_an_error
?
saltpylint/blacklist.py
Outdated
except ValueError: | ||
pass | ||
else: | ||
self.blacklisted_functions[key] = val |
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.
We no longer need the previous logic?
Co-authored-by: Pedro Algarvio <[email protected]>
Co-authored-by: Pedro Algarvio <[email protected]>
…nfig. - remove Py2 code check
@s0undt3ch thx for looking into my pr. Please check my latest commits which address all your review comments |
Current saltpylint works with pylint==2.13.9. It does not work with
newer versions of pylint such as 2.17 ... 3.0.3. Pylint 3.0.3 includes
many code changes, such as remove exposed checker interfaces, remove
some https://github.com/utils fucitons, remove checker member functions (config) .. The
submitted pr removes those disappeared functions. Review is required to
make sure it does not remove necessary checks as a result.
This commit will fix issues