Skip to content

Commit

Permalink
Treat some edge cases in google docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
AloizioMacedo committed Apr 15, 2024
1 parent 8cffa93 commit 6dc58b3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/parsing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ pub fn parse_google_docstring(
args = &args[..c];
};

if let Some(c) = args.find("Raises:\n") {
args = &args[..c];
};

if break_on_empty_line {
if let Some(c) = args.find("\n\n") {
args = &args[..c];
Expand Down Expand Up @@ -73,6 +77,7 @@ pub fn parse_google_docstring(
};

let typ = typ.trim_start_matches('(').trim_end_matches(')');
let typ = typ.trim_end_matches(", optional");

params.push((name, Some(typ)));
}
Expand Down

0 comments on commit 6dc58b3

Please sign in to comment.