-
Notifications
You must be signed in to change notification settings - Fork 17
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
Allow parallel lint and remove broken "verbose" mode #36
Conversation
4900b12
to
16b68c7
Compare
Pylint supports parallel execution, let's allow it in inspekt as well. One draw-back of this is that when parallel pylint is enabled, it does not reports passed tests as usual, therefor there is no simple way of adding our "Lint: %(path)s %(status)" debug messages. It is not impossible, but not feasible, therefor this version prints the list of results after the execution. Also instead of filename it prints module name (for the same reason). Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
The "--verbose" argument is already consumed by cliff's App() and is used to set logging levels. It is not passed to sub-commands and therefor the removed code in lint did not work. Using "--verbose" still changes the logging levels, so all the "checker.log_status()" messages are only printed when "--verbose" is enabled. This patch removes the original "verbose" mode for "pylint" because it does not actually work every since we moved to cliff. Since no one complained about it I think it's better to remove it and keep the current behavior which is to run normal pylint and log the "checker.log_status()" messages in "verbose" mode. Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
The newly introduced W605 informs about places where non-existing escape is used, which used to be automatically escaped but is about to become syntax error. Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
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.
Nice, LGTM.
Thanks for the other fixes too.
inspektor/lint.py
Outdated
@@ -54,9 +54,13 @@ def __init__(self, args, logger=logging.getLogger('')): | |||
self.log = logger | |||
self.args = args | |||
self.verbose = args.verbose | |||
if hasattr(args, 'parallel'): |
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 was really intrigued on why this was necessary: basically the default
should set this always. Then I remember that sometimes lint is called by checkall
, so yes, 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.
exactly (and Travis actually reminded me this on this very PR)
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.
Looks good!
The first commit adds "parallel" execution of "inspekt lint" and the second one removes the "--verbose" mode from all sub-commands, because it is not really passed as an argument. Partially it works in the sense the loggers are set by the main app to DEBUG vs. INFO leading to some messages being printed, but the different setting for lint does not work. As this issue is with us for quite a while I choose to remove it and keep only to already working DEBUG vs. INFO part as it might be useful to people.
Note: It'd be nice to release new inspektor with this commit to speedup the Travis executions.