mirror of
https://github.com/RGBCube/alejandra
synced 2025-08-01 04:57:44 +00:00
feat: trim end of whitespace lines
This commit is contained in:
parent
c671ef15fc
commit
b6679fa6e3
4 changed files with 21 additions and 21 deletions
|
@ -10,6 +10,4 @@ let
|
||||||
};
|
};
|
||||||
flake = import flakeCompatSrc { src = ./.; };
|
flake = import flakeCompatSrc { src = ./.; };
|
||||||
in
|
in
|
||||||
flake
|
flake.defaultNix.defaultPackage
|
||||||
.defaultNix
|
|
||||||
.defaultPackage
|
|
||||||
|
|
|
@ -91,11 +91,13 @@ pub fn rule(
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
if portions.len() == 1 {
|
if portions.len() == 1 {
|
||||||
|
if portions[0].len() > 0 || index + 1 == lines.len() {
|
||||||
steps.push_back(crate::builder::Step::Pad);
|
steps.push_back(crate::builder::Step::Pad);
|
||||||
steps.push_back(crate::builder::Step::Token(
|
steps.push_back(crate::builder::Step::Token(
|
||||||
rnix::SyntaxKind::TOKEN_STRING_CONTENT,
|
rnix::SyntaxKind::TOKEN_STRING_CONTENT,
|
||||||
portions[0].to_string(),
|
portions[0].to_string(),
|
||||||
));
|
));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
steps.push_back(crate::builder::Step::Pad);
|
steps.push_back(crate::builder::Step::Pad);
|
||||||
for (index, portion) in portions.iter().enumerate() {
|
for (index, portion) in portions.iter().enumerate() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue