Skip to content

Commit

Permalink
Add dedicated warning for empty stdin (#9256)
Browse files Browse the repository at this point in the history
## Summary

I ran into this in practice:

![Screenshot 2024-11-19 at 4 20
37 PM](https://github.com/user-attachments/assets/d89aa9f1-828a-492e-af5a-3434e277580e)
  • Loading branch information
charliermarsh authored Nov 19, 2024
1 parent 9fb7f81 commit f4799d2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions crates/uv-requirements-txt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,14 @@ impl RequirementsTxt {
error: err,
})?;
if data == Self::default() {
warn_user!(
"Requirements file {} does not contain any dependencies",
requirements_txt.user_display()
);
if requirements_txt == Path::new("-") {
warn_user!("No dependencies found in stdin");
} else {
warn_user!(
"Requirements file {} does not contain any dependencies",
requirements_txt.user_display()
);
}
}

Ok(data)
Expand Down

0 comments on commit f4799d2

Please sign in to comment.