Skip to content

Conversation

@drupol
Copy link
Owner

@drupol drupol commented Jul 22, 2025

This PR

  • emit empty lines without trailing whitespace

fix #7

@drupol
Copy link
Owner Author

drupol commented Jul 22, 2025

@wolfgangwalther Feel free to review it :)

@drupol drupol force-pushed the push-zzqwtprrtxok branch from 4f28558 to 230f8f8 Compare July 22, 2025 15:40
@wolfgangwalther
Copy link
Contributor

I'd like to try this when #8 is merged and this branch rebased on it. That's easier with the override I already have.

@drupol drupol force-pushed the push-zzqwtprrtxok branch from 230f8f8 to dd81e6a Compare July 22, 2025 16:04
@drupol
Copy link
Owner Author

drupol commented Jul 22, 2025

Here you go, let me know how it goes, after that I think this project will deserve a tag.

@wolfgangwalther
Copy link
Contributor

I get a test failure on this branch when building:

       last 25 log lines:
       > test test_invalid_config_fails_with_error ... ok
       > test test_multiple_code_blocks ... ok
       > test test_multiple_files_in_dir_one_is_fixed ... FAILED
       > test test_multiple_files_in_dir_one_with_issue ... ok
       > test test_no_code_blocks_means_no_changes ... ok
       > test test_output_mode_check_fails_on_error ... ok
       > test test_prints_warning_on_failure ... ok
       > test test_rewrites_code_block ... ok
       > test test_unsupported_language_is_skipped ... ok
       >
       > failures:
       >
       > ---- test_multiple_files_in_dir_one_is_fixed stdout ----
       >
       > thread 'test_multiple_files_in_dir_one_is_fixed' panicked at tests/tests.rs:454:5:
       > assertion failed: output.status.success()
       > note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
       >
       >
       > failures:
       >     test_multiple_files_in_dir_one_is_fixed
       >
       > test result: FAILED. 13 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.62s
       >
       > error: test failed, to rerun pass `--test tests`
       For full logs, run 'nix log /nix/store/4g9yr6d2h28x28x8hml7g5s07m47i40f-markdown-code-runner-0-unstable-2025-07-22.drv'.

src/runner.rs Outdated
}),
)
.chain(std::iter::once("```".to_string()))
.map(|l| format!("{:indent$}{}", "", l, indent = block.indent))
Copy link
Contributor

Choose a reason for hiding this comment

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

After disabling the checkPhase, I ran it, but this doesn't work for me, yet.

Should the trimming happen after the indent step here? I think it should!

Copy link
Contributor

Choose a reason for hiding this comment

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

Or put differently: Only indent, when the line is non-empty?

Copy link
Owner Author

Choose a reason for hiding this comment

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

I updated it, it would be super great if you could give me some feedback to get this done.

Copy link
Contributor

Choose a reason for hiding this comment

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

on it

@drupol drupol force-pushed the push-zzqwtprrtxok branch 2 times, most recently from 7a27d11 to 6f2e4d2 Compare July 22, 2025 16:40
Copy link
Contributor

@wolfgangwalther wolfgangwalther left a comment

Choose a reason for hiding this comment

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

Yes, this works!

@drupol
Copy link
Owner Author

drupol commented Jul 22, 2025

Waiting for a last confirmation from you and merging this.

@wolfgangwalther
Copy link
Contributor

cargo-fmt doesn't like it, yet, but I tested and confirmed again: Still works as expected!

@drupol drupol force-pushed the push-zzqwtprrtxok branch from 1d2585b to 0011265 Compare July 22, 2025 16:50
@drupol
Copy link
Owner Author

drupol commented Jul 22, 2025

Excellent !

fix #7

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
@drupol drupol force-pushed the push-zzqwtprrtxok branch from 0011265 to 57cd462 Compare July 22, 2025 16:53
@drupol drupol merged commit 058863d into main Jul 22, 2025
3 checks passed
@drupol drupol deleted the push-zzqwtprrtxok branch July 22, 2025 16:56
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.

Emit empty lines without trailing whitespace

3 participants