Skip to content

Commit

Permalink
chore: Avoid unnecessary assignment before for-loop
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Sep 28, 2024
1 parent 226896f commit 266c765
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,8 +848,7 @@ def lint(filename, additional_properties):
document = get_html(url)
document.make_links_absolute(url)
for url in document.xpath('//@href[contains(., ".csv")]'):
reader = csv.DictReader(StringIO(get(url).text))
for row in reader:
for row in csv.DictReader(StringIO(get(url).text)):
known_codes.add(row["Code"])

with codes_txt.open("w") as f:
Expand Down Expand Up @@ -1449,8 +1448,7 @@ def report(path, row):
for path in (mappingdir, mappingdir / "shared"):
for filename in path.glob("*.csv"):
with filename.open() as f:
reader = csv.DictReader(f)
for row in reader:
for row in csv.DictReader(f):
if row.get("guidance"):
for match in re.finditer(r"(?:([a-z]+)'s )?\[?`([^`]+)`", row["guidance"]):
path = match.group(2)
Expand Down

0 comments on commit 266c765

Please sign in to comment.