Skip to content

Commit

Permalink
fix: Capturing module names ending in "url" as url param
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmah309 committed Dec 14, 2024
1 parent 070e693 commit 4cdde38
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ pub fn update(path: &Path) -> anyhow::Result<()> {
let reader = io::BufReader::new(input_file);

let mut lines: Vec<String> = Vec::new();
let commit_capture_regex = regex::Regex::new(r"^(\s*commit:\s*)([0-9a-f]+)(\s*.*)$")?;
let url_capture_regex = regex::Regex::new(r"\s*url:\s*(.*)")?;
let commit_capture_regex = regex::Regex::new(r"^(\s+commit:\s+)([0-9a-f]+)(\s*.*)$")?;
let url_capture_regex = regex::Regex::new(r"\s+url:\s+(.*)")?;

let mut latest_commit = String::new();
let mut commit_line: usize = usize::MAX;
Expand All @@ -37,7 +37,7 @@ pub fn update(path: &Path) -> anyhow::Result<()> {
}
let current_repo_url = captures.get(1).map_or("", |m| m.as_str()).to_string();
latest_commit = get_latest_commit_sha(&current_repo_url)
.with_context(|| format!("Line number '{}'", line_number))?
.with_context(|| format!("Failure occurred at line number '{}' in {}", line_number, YARD_YAML_FILE_NAME))?
}

// Check if the line matches the commit pattern
Expand Down

0 comments on commit 4cdde38

Please sign in to comment.