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
Don't show no-op regex-lint output. #14656
Conversation
Before, on a branch with no changes:
After:
|
Other linters only display output if they acted on at least one file. Previously, we would always show regex-lint output, even in the no-op case of acting on no files. This change brings regex-lint into line with the other linters. [ci skip-rust] [ci skip-build-wheels]
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.
Great catch!
src/python/pants/core/goals/lint.py
Outdated
if request_type.name in specified_names and specs_snapshot.snapshot.files | ||
) |
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.
Peformance nit: you can make this O(1) rather than O(n):
if request_type.name in specified_names and specs_snapshot.snapshot.files | |
) | |
if request_type.name in specified_names | |
) if specs_snapshot.snapshot.files else () |
(Black might not like this formatting, so better to manually apply the fix)
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
Other linters only display output if they acted on at least one file. Previously, we would always show regex-lint output, even in the no-op case of acting on no files. This change brings regex-lint into line with the other linters. [ci skip-rust] [ci skip-build-wheels]
Other linters only display output if they acted on at least one file. Previously, we would always show regex-lint output, even in the no-op case of acting on no files. This change brings regex-lint into line with the other linters. [ci skip-rust] [ci skip-build-wheels] Co-authored-by: Benjy Weinberger <benjyw@gmail.com>
Other linters only display output if they acted on at least one file.
Previously, we would always show regex-lint output, even in the
no-op case of acting on no files. This change brings regex-lint
into line with the other linters.
[ci skip-rust]
[ci skip-build-wheels]