Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions command-signatures/src/generators/apt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ const LIST_ALL_DEB_FILES_COMMAND: &str = r#"find . -maxdepth 1 -type f -name '*.
pub fn list_all_packages(output: &str) -> GeneratorResults {
let mut targets = Vec::new();
for package_name in output.lines() {
targets.push(Suggestion::with_description(
package_name.to_string(),
"package",
));
if !package_name.is_empty() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

importantstr::lines() treats the final line ending as optional, so the ordinary trailing newline from dpkg-query yields no empty segment and cannot produce the blank suggestion #380 describes. This guard therefore only filters a genuine interior blank line or a doubled trailing newline, meaning the reported reproduction is not the one being fixed here. Confirm the input that actually reproduces and pin it with a test, or narrow #380 and this change to that case.

targets.push(Suggestion::with_description(
package_name.to_string(),
"package",
));
}
}
targets.into_iter().collect_unordered_results()
}
Expand All @@ -40,6 +42,9 @@ pub fn list_available_packages(output: &str) -> GeneratorResults {
pub fn list_all_deb_files_in_cwd(output: &str) -> GeneratorResults {
let mut targets = Vec::new();
for file in output.lines() {
if file.is_empty() {
continue;
}
targets.push(
// We should prioritize .deb files over the already installed packages.
Suggestion::with_description(file.to_string(), ".deb file")
Expand Down Expand Up @@ -98,3 +103,4 @@ pub fn aptitude_generators() -> CommandSignatureGenerators {
),
)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

important — This EOF blank line is the sole cause of the failing lint job: cargo fmt -p warp-command-signatures -p warp-completion-metadata --check reports exactly this line at apt.rs:103. It is also the entire content of the Trigger review loop commit, which makes no functional change. Drop that commit to remove the line and turn CI green.

Loading