-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Make luigi package more flake8 compliant #1175
Conversation
@@ -97,7 +101,8 @@ def _get_str(task_dict, extra_indent): | |||
break | |||
if len(tasks[0].get_params()) == 0: | |||
row += '- {0} {1}()'.format(len(tasks), str(task_family)) | |||
elif _get_len_of_params(tasks[0]) > 60 or (len(tasks) == 2 and len(tasks[0].get_params()) > 1 and (_get_len_of_params(tasks[0]) > 40 or len(str(tasks[0])) > 100)) or len(str(tasks[0])) > 200: | |||
elif _get_len_of_params(tasks[0]) > 60 or len(str(tasks[0])) > 200 or \ |
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 thought \
were unpythonic and one preferred parenthesis? No?
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 guess there is no more or less pythonic. In my opinion - pythonic mean better readable.
In some cases parenthesis better readable but in this case - this condition \
looks good. Condition must no be over-parenthesised.
https://www.python.org/dev/peps/pep-0008/#maximum-line-length
Backslashes may still be appropriate at times. For example, long, multiple with -statements cannot use implicit continuation, so backslashes are acceptable:
Awesome progress, for future reference, this a continuation of #1174. |
Thanks so much for caring about the code quality of luigi! :) |
What's "govnokod" by the way? I only found results in Russian. :) |
We use
Well.. It is very specific term. Usually govnokod generated by anything but not developers head. It is like monkey code but a little bit different. Talk is cheap. I show you the code: http://govnokod.ru :-)) |
' - other_worker ran 1 tasks\n\n' | ||
'Did not run any tasks\n' | ||
'This progress looks :) because there were no failed ' | ||
'tasks or missing external dependencies\n', s) |
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.
Ah this looks so much nicer! :)
Make luigi package more flake8 compliant
This is so awesome! Thanks :) |
Motivation of this PR was to make flake8 checks as strict as possible.
Before:
After:
This will protect luigi package from govnokod.
In future
max-line-length
should be less then 120 chars for better readability.