Conversation
- fix last line swallow when it doesn't end with newline - fix last char being newline swallow
| files: README.md | ||
| files: ^README.md$ | ||
| always_run: true | ||
| pass_filenames: false |
There was a problem hiding this comment.
If there are no changes to README.md with always_run it is run without README.md being passed as the cli arg param
| .context("parsing markdown")?; | ||
|
|
||
| self.process_piece(MdPiece::RawLine(remaining_input)) | ||
| .context("processing remaining unparsed input")?; |
There was a problem hiding this comment.
This can happen when last character of the input is not newline. We can't add nom::combinator::rest at the end as then iterator will keep matching on it forever.
| use anyhow::Context; | ||
|
|
||
| /// Trims trailing ASCII whitespace from a byte slice. | ||
| /// Stable alternative to the unstable `trim_ascii_end()` method. |
There was a problem hiding this comment.
It is stable since 1.80.0
There was a problem hiding this comment.
Looks like the CI cargo version is outdated
There was a problem hiding this comment.
I bumped nixos to 25.11 but the rustc version there is 1.78. I don't have much experience with nix, is there any quick fix, @zimbatm? It would be nice to have the latest version features available (which is 1.92 as of today)
There was a problem hiding this comment.
nixos-unstable is at 1.89.0. Is that enough?
| let mut out = | ||
| File::create(outf).with_context(|| format!("failed to write file {outf:?}"))?; | ||
| out.write(buffer.trim_ascii_end())?; | ||
| out.write(b"\n")?; |
There was a problem hiding this comment.
This caused some parsing failures (that should be fixed). And it's incompatible with the precommit's end-of-file-fixer hook
end-of-file-fixerhook)