Skip to content

Commit

Permalink
Fix ruff lints
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkdp committed Nov 22, 2024
1 parent 35f7a72 commit 95b22de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions ft/ft/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,9 @@ def contains(substring, inp):
@register("nonempty", "non_empty")
@typed(None, T_BOOL)
def nonempty(inp):
if type(inp) == list:
if type(inp) is list:
return bool(inp)
elif type(inp) == str:
elif type(inp) is str:
return inp.strip() != ""

return True
Expand Down Expand Up @@ -426,15 +426,15 @@ def format(format_str, inp):
@typed(None, None)
def reverse(inp):
# slice arrays and string from start to finish in reversed order
if type(inp) == str or type(inp) == list:
if type(inp) is str or type(inp) is list:
return inp[::-1]

# treat integers as strings
elif type(inp) == int:
elif type(inp) is int:
return str(inp)[::-1]

# booleans can not be reversed
elif type(inp) == bool:
elif type(inp) is bool:
panic("Cannot reverse bool value")

# we got something unexpected
Expand Down
2 changes: 1 addition & 1 deletion ft/tests/test_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ def test_min():
assert cmd.output() == ["-5"]


def test_max_column():
def test_min_column():
cmd = mock(Foldl1, ("min", [], ["a\t1", "b\t7", "c\t0", "d\t5"]), column=2)
assert cmd.output() == ["0"]

0 comments on commit 95b22de

Please sign in to comment.