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

Address some pylint notices #403

Merged
merged 7 commits into from
Nov 24, 2024
Merged

Conversation

FichteFoll
Copy link
Member

This is an alternative to #402 with the problematic commits dropped and some linter fixes applied.

evidencebp and others added 7 commits November 11, 2024 19:10
The function _create_package uses os.mkdir and catch exception.
This is too wide since mkdir catches specific exception.
That might catch and hide new exception (e.g., in case that more code will be added to the try section).

For the mkdir exceptions see:
https://docs.python.org/3/library/os.html#os.mkdir
Removed unneeded parentheses in return statement
Removed unneeded parenthesis in
python_arg_scope = ("source.python meta.function-call.arguments.python string.quoted")

I suspected that the other might intended to create a tuple.
To create a single element tuple you need a comma at the end like
python_arg_scope = ("source.python meta.function-call.arguments.python string.quoted",)
So python_arg_scope was a string anyway

Also in line 262, in quite a similar code, there are no parenthesis.
Function match_selector had 7 return statements while pylint recommends to have at most 6.
I assigned the return values into the result variable and use a single statement returning in the end of the function.
The methods validate_data and write of DumperProto should be overridden by subclasses (as discussed with FichteFoll).
Instead of leaving with just pass changed to raise NotImplementedError to verify that they are not mistakenly used.
The method parse of LoaderProto should be overridden by subclasses (as discussed with FichteFoll). Instead of leaving with just pass changed to raise NotImplementedError to verify that they are not mistakenly used.
@FichteFoll FichteFoll merged commit fd067a4 into master Nov 24, 2024
2 checks passed
@FichteFoll FichteFoll deleted the feature/pylint-interventions branch November 24, 2024 21:49
@evidencebp
Copy link
Contributor

Thanks!

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.

2 participants