Skip to content

Commit

Permalink
Fix previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardobranco777 committed Nov 2, 2023
1 parent 52cb619 commit e820dd7
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions scantags.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,27 +167,27 @@ def scan_tags( # pylint: disable=too-many-locals
futures.append(executor.submit(blame.blame_file, file))
concurrent.futures.wait(futures)

tags: dict[str, list[dict[str, str | int | datetime]]] = defaultdict(list)
for file, matches in file_matches.items():
for line_number, tag in matches:
# build.opensuse.org & bugzilla.novell.com -> bugzilla.suse.com
if tag.startswith(("bnc", "boo")):
tag = tag.replace("boo", "bsc").replace("bnc", "bsc")
try:
author, email, commit, date = blame.blame_line(file, line_number)
except KeyError as exc:
logging.warning("%s", exc)
continue
info: dict[str, str | int | datetime] = {
"file": file,
"line_number": line_number,
"author": author,
"email": email,
"date": utc_date(date),
"commit": f"{base_url}/commit/{commit}",
"url": f"{base_url}/blob/{branch}/{file}#L{line_number}",
}
tags[tag].append(info)
tags: dict[str, list[dict[str, str | int | datetime]]] = defaultdict(list)
for file, matches in file_matches.items():
for line_number, tag in matches:
# build.opensuse.org & bugzilla.novell.com -> bugzilla.suse.com
if tag.startswith(("bnc", "boo")):
tag = tag.replace("boo", "bsc").replace("bnc", "bsc")
try:
author, email, commit, date = blame.blame_line(file, line_number)
except KeyError as exc:
logging.warning("%s", exc)
continue
info: dict[str, str | int | datetime] = {
"file": file,
"line_number": line_number,
"author": author,
"email": email,
"date": utc_date(date),
"commit": f"{base_url}/commit/{commit}",
"url": f"{base_url}/blob/{branch}/{file}#L{line_number}",
}
tags[tag].append(info)

for files in tags.values():
files.sort(key=itemgetter("file", "line_number"))
Expand Down

0 comments on commit e820dd7

Please sign in to comment.