Skip to content

Commit

Permalink
OD-1730: Fix-up some easily fixable noqa items
Browse files Browse the repository at this point in the history
Specifically, this targets E701 (if head and body on same line, fixed
already by ruff format), E721 (not using isinstance).
  • Loading branch information
hlieberman committed Nov 4, 2023
1 parent e603a36 commit 089ca53
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion 05-Create-Open-Doors-Tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def main(args, log):
final.story_to_final_without_tags(bookmark, bookmark_authors, False)
)
if final_bookmarks:
final.insert_into_final("story_links", final_bookmarks) # noqa: E701
final.insert_into_final("story_links", final_bookmarks)

# AUTHORS
log.info(
Expand Down
4 changes: 2 additions & 2 deletions shared_python/FinalTables.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ def _escape_unescape(self, item):
def _value(self, row):
value = []
for item in row:
if type(item) is str: # noqa: E721
if isinstance(item, str):
value.append('"' + self._escape_unescape(item) + '"')
elif type(item) is datetime.datetime:
elif isinstance(item, datetime.datetime):
value.append('"' + str(item) + '"')
elif item is None:
value.append("null")
Expand Down
4 changes: 2 additions & 2 deletions shared_python/Tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ def populate_tag_table(
if story_tags_row[col] is not None:
for val in re.split(r", ?", story_tags_row[col]):
if val != "":
if (
type(tag_col_lookup[col]) is str # noqa: E721
if isinstance(
tag_col_lookup[col], str
): # Probably AA or a custom archive
cleaned_tag = (
val.encode("utf-8").replace("'", "'").strip()
Expand Down

0 comments on commit 089ca53

Please sign in to comment.