-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fixes #5529: Print python lint errors at the end of the check #6005
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #6005 +/- ##
=======================================
Coverage 45.3% 45.3%
=======================================
Files 520 520
Lines 30667 30667
Branches 4597 4597
=======================================
Hits 13893 13893
Misses 16774 16774
Continue to review full report at Codecov.
|
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.
Hi @apb7, just a nit!
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!
sending this to @seanlip and @BenHenning for code owner review.
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. Just one confirmation.
pycodestyle_report = style_guide.check_files( | ||
paths=current_files_to_lint) | ||
# This line prints Pycodestyle's output to the console. | ||
pycodestyle_report.print_statistics() |
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.
This line seems to be missing below. Is this intentional?
Yes, we do not need that line now. I had earlier placed it thinking that it
prints the errors but just invoking pycodestyle in the line above prints
the errors. Thanks!
…On Sat, Dec 22, 2018, 9:46 AM Nithesh N. Hariharan ***@***.***> wrote:
***@***.**** approved this pull request.
LGTM. Just one confirmation.
------------------------------
In scripts/pre_commit_linter.py
<#6005 (comment)>:
> @@ -524,18 +536,21 @@ def _lint_py_files(config_pylint, config_pycodestyle, files_to_lint, result):
print 'Linting Python files %s to %s...' % (
current_batch_start_index + 1, current_batch_end_index)
- # This line invokes Pylint and prints its output to the console.
- pylinter = lint.Run(
- current_files_to_lint + [config_pylint],
- exit=False).linter
- # These lines invoke Pycodestyle.
- style_guide = pycodestyle.StyleGuide(config_file=config_pycodestyle)
- pycodestyle_report = style_guide.check_files(
- paths=current_files_to_lint)
- # This line prints Pycodestyle's output to the console.
- pycodestyle_report.print_statistics()
This line seems to be missing below. Is this intentional?
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#6005 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AXrQuedDFPndloTPEJ1v_Z6ML2cFJyvuks5u7bILgaJpZM4Zaclp>
.
|
Explanation
Fixes #5529.
Redirects the output from stdout to a temporary stream using context manager as suggested by @seanlip here. This stream is later used to retrieve the output and put in
result
queue.Checklist
python scripts/pre_commit_linter.py
andbash scripts/run_frontend_tests.sh
.