Skip to content
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

Change default behavior for missing output #1466

Merged
merged 4 commits into from
Feb 5, 2025
Merged

Change default behavior for missing output #1466

merged 4 commits into from
Feb 5, 2025

Conversation

brynary
Copy link
Member

@brynary brynary commented Feb 2, 2025

Prior to this PR, if a linter exited with a success exit code but did not produce any output, we would hand an empty string to the parser. In substantially all situations, this will result in a confusing EOF error from the parser, because it will try to e.g. parse an empty string as JSON.

This PR changes the default -- If a linter exits with a success exit code, but does not produce output, we will treat that as a Lint Error and skip the parser phase entirely.

This behavior can be overridden by two alternative behaviors: parse or no_issues. parse will invoke the parser with an empty string, and no_issues will treat the empty output as if it produced output along the lines of issues = []

(Previously, we had a missing_output_as_error boolean. The new output_missing enum replaces that.)

Copy link
Contributor

qltysh bot commented Feb 2, 2025

The code coverage on the diff in this pull request is 73.5%

Drilldown
Path File Coverage Δ
qlty-check/src/executor/driver.rs * -0.9
qlty-check/src/executor/invocation_result.rs 0.6
qlty-check/src/tool/command_builder.rs * 2.6
qlty-check/src/tool/download.rs * 0.7
qlty-check/src/tool/ruby/sys/linux.rs * -1.6
qlty-check/src/tool/ruby/sys/macos.rs * 3.1
qlty-cli/src/initializer/scanner/gemfile.rs * 0.3
qlty-cloud/src/auth/auth_flow.rs * -0.5
qlty-config/src/library.rs * 0.5

Copy link
Contributor

qltysh bot commented Feb 2, 2025

The code coverage on the diff in this pull request is 73.5%

Drilldown
Path File Coverage Δ
qlty-check/src/executor/invocation_result.rs 0.6
qlty-config/src/library.rs * 0.5

Copy link
Contributor

qltysh bot commented Feb 2, 2025

1 new issue

Tool Category Rule Count
qlty Structure High total complexity (count = 54) 1

qlty successfully analyzed this pull request in 4m.

@brynary brynary requested review from marschattha, lsegal and noahd1 and removed request for marschattha February 2, 2025 01:26
@brynary brynary merged commit 4bbe974 into main Feb 5, 2025
10 of 11 checks passed
@brynary brynary deleted the bh-output-missing branch February 5, 2025 02:18
brynary added a commit that referenced this pull request Feb 5, 2025
brynary added a commit that referenced this pull request Feb 5, 2025
@marschattha marschattha restored the bh-output-missing branch February 5, 2025 20:37
marschattha added a commit that referenced this pull request Feb 5, 2025
#1466 again with `output_missing =
"parse"` for all linters except eslint and kubelint

---------

Co-authored-by: Bryan Helmkamp <bryan@brynary.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant