diff --git a/doc/data/messages/n/no-else-return/bad.py b/doc/data/messages/n/no-else-return/bad.py new file mode 100644 index 0000000000..99edf5fa4c --- /dev/null +++ b/doc/data/messages/n/no-else-return/bad.py @@ -0,0 +1,7 @@ +def compare_numbers(a: int, b: int) -> int: + if a == b: # [no-else-return] + return 0 + elif a < b: + return -1 + else: + return 1 diff --git a/doc/data/messages/n/no-else-return/good.py b/doc/data/messages/n/no-else-return/good.py new file mode 100644 index 0000000000..b8b4570ee2 --- /dev/null +++ b/doc/data/messages/n/no-else-return/good.py @@ -0,0 +1,6 @@ +def compare_numbers(a: int, b: int) -> int: + if a == b: + return 0 + if a < b: + return -1 + return 1