Skip to content
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

Merged
merged 9 commits into from
Feb 1, 2024

Conversation

MaxBear
Copy link
Contributor

@MaxBear MaxBear commented Jan 30, 2024

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

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
@mirceaulinic
Copy link

@s0undt3ch would you mind having a look please? =)

saltpylint/thirdparty.py Outdated Show resolved Hide resolved

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

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

Copy link
Contributor Author

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

@@ -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):
Copy link
Member

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

Copy link
Contributor Author

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

msgid = 'E1321'
else:
msgid = 'W1321'
msgid = 'W1321'
Copy link
Member

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/py3modernize/__init__.py Outdated Show resolved Hide resolved
except ValueError:
pass
else:
self.blacklisted_functions[key] = val
Copy link
Member

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?

@MaxBear
Copy link
Contributor Author

MaxBear commented Feb 1, 2024

@s0undt3ch thx for looking into my pr. Please check my latest commits which address all your review comments

@s0undt3ch s0undt3ch merged commit 605f19c into saltstack:master Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants