-
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
Converted python code to pylint compliant. #32
Converted python code to pylint compliant. #32
Conversation
36a51d4
to
98a485f
Compare
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.
Very good intiative!
This PR is mixing refactoring code functionality and linting so it is a bit hard to follow.
I cannot guarantee 100% that you are not changing some functionality. Were you able to test on a couple of examples at least?
A couple of points:
- don't use
\
to break lines except in very special occasion (cf PEP8) - I am wondering if simply you dont want
@staticmethod
rather than@classmethod
everywhere. I guess you were trying to escape the infamousmethod could be a function
pylint warning. Though in this case it makes life a bit less understandable. There is not really a reason for the checktext method to be a classmethod if the only place where we are using the class is in some debug log. - Sometimes pylint is having strong opinions that can decrease readability
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.
What is the purpose of the log in the class? It looks like it was added only to avoid to trigger unused import
- more logging is good but some of these log messages do not make sense.
What do you mean with Check * rule does not exist
- are you saying that the rule was not triggered for this given line? If so it maybe make sense for the method that returns True / False but for the one returning a result or a regex it is not possible to assert before the return
statement if the check
exist or not and so the logs seem incorrect.
Two things:
- It is better to log when a rule is triggered in debug rather than when it is not I would argue
- If the only purpose of the log message is to cater for
unused-import
I would not add it
75a4822
to
7da4e99
Compare
3f24bfb
to
cdd2979
Compare
1d62470
to
a11bc34
Compare
Note: this is introducing pylint check in the workflow - the workflow is currently failing until #32 is merged into devel
3af39b9
to
d0f5d59
Compare
Co-authored-by: Guillaume Mulocher <[email protected]>
Co-authored-by: Guillaume Mulocher <[email protected]>
Co-authored-by: Guillaume Mulocher <[email protected]>
Co-authored-by: Guillaume Mulocher <[email protected]>
4394628
to
0e6114b
Compare
* following pylint refactoring, either adjust the tests that are not valid anymore or remove them (2) * in one occasion fixed some refactoring issue (returning Rule instead of Rule() in the load_plugins function) * in one occasion set the correct error to be returned for a rule * fix ordering of steps for CLI run method for stdin
this is done to follow the new filename structure for the corresponding rules.
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.
LGTM
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.
LGTM!
Updating the code to make it pylint compliant.