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

Use tab writer to improve output of invocations and errors #1356

Merged
merged 4 commits into from
Dec 21, 2024

Conversation

brynary
Copy link
Member

@brynary brynary commented Dec 20, 2024

No description provided.

Copy link
Contributor

qltysh bot commented Dec 20, 2024

❌ 3 blocking issues (8 total)

Tool Category Rule Count
clippy Lint format! in format! args 2
clippy Lint written amount is not handled 1
qlty Duplication Found 19 lines of similar code in 3 locations (mass = 69) 3
qlty Structure Deeply nested control flow (level = 5) 2

qlty successfully analyzed this pull request in 2m.

let outfile_path = pathdiff::diff_paths(absolute_outfile_path, &cwd).unwrap();

match invocation.status() {
InvocationStatus::Success => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 19 lines of similar code in 3 locations (mass = 69) [qlty:similar-code]

)
.unwrap();
}
InvocationStatus::LintError => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 19 lines of similar code in 3 locations (mass = 69) [qlty:similar-code]

)
.unwrap();
}
InvocationStatus::ParseError => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 19 lines of similar code in 3 locations (mass = 69) [qlty:similar-code]

match invocation.invocation.exit_code {
Some(code) => {
tw.write_all(
format!(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format! in format! args [clippy:format_in_format_args]

.unwrap();

if invocation.invocation.stderr.is_empty() {
if !invocation.invocation.stdout.is_empty() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deeply nested control flow (level = 5) [qlty:nested-control-flow]

let text: String =
invocation.invocation.stdout.chars().take(2048).collect();
invocation.invocation.stderr.chars().take(2048).collect();

for line in text.lines() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deeply nested control flow (level = 5) [qlty:nested-control-flow]


for line in text.lines() {
writeln!(writer, " {}", style(line).red())?;
tw.write(format!(" {}", style(line).red()).as_bytes())?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

written amount is not handled [clippy:unused_io_amount]

printed_summary = true;
None => {
tw.write_all(
format!(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format! in format! args [clippy:format_in_format_args]

Copy link
Contributor

qltysh bot commented Dec 20, 2024

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

Drilldown
Path File Coverage Δ
qlty-check/src/tool/command_builder.rs -2.6
qlty-check/src/tool/ruby/sys/macos.rs -3.1
qlty-check/src/tool/download.rs -0.7
qlty-cli/src/ui/invocations.rs -5.9
qlty-check/src/executor/driver.rs 0.9
qlty-check/src/tool/ruby/sys/linux.rs 1.6
qlty-check/src/parser/clippy.rs -0.3

@brynary brynary merged commit a4d457e into main Dec 21, 2024
9 of 11 checks passed
@brynary brynary deleted the bh-improve-output branch December 21, 2024 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant