-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow comments after all requirements.txt entries #3018
Conversation
@@ -801,9 +799,7 @@ fn parse_requirement_and_hashes( | |||
})?; | |||
|
|||
let hashes = if has_hashes { | |||
let hashes = parse_hashes(content, s)?; | |||
eat_trailing_line(content, s)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary, I think, because the next step after parsing an entry is to eat the trailing line.
@@ -581,7 +581,6 @@ fn parse_entry( | |||
Ok(Some(if s.eat_if("-r") || s.eat_if("--requirement") { | |||
let requirements_file = parse_value(content, s, |c: char| !['\n', '\r', '#'].contains(&c))?; | |||
let end = s.cursor(); | |||
eat_trailing_line(content, s)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary, I think, because the next step after parsing an entry is to eat the trailing line.
@@ -590,19 +589,18 @@ fn parse_entry( | |||
} else if s.eat_if("-c") || s.eat_if("--constraint") { | |||
let constraints_file = parse_value(content, s, |c: char| !['\n', '\r', '#'].contains(&c))?; | |||
let end = s.cursor(); | |||
eat_trailing_line(content, s)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary, I think, because the next step after parsing an entry is to eat the trailing line.
9ebe565
to
9254dd5
Compare
Summary
I'm surprised we haven't hit this before, but apparently we don't allow comments after
--index-url
,-e
entries, etc., in the requirements.txt parser.Closes #3011.
Test Plan
cargo test