Skip to content

Commit 6537f38

Browse files
committed
Annotate all command function return values
1 parent 70af03e commit 6537f38

31 files changed

+31
-31
lines changed

userland/utilities/basename.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727

2828
@core.command(parser)
29-
def python_userland_basename(opts, args: list[str]):
29+
def python_userland_basename(opts, args: list[str]) -> int:
3030
parser.expect_nargs(args, (1,))
3131

3232
if opts.suffix:

userland/utilities/cat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def cat_io(opts, stream: Iterable[bytes]) -> None:
134134

135135

136136
@core.command(parser)
137-
def python_userland_cat(opts, args: list[str]):
137+
def python_userland_cat(opts, args: list[str]) -> int:
138138
if opts.show_all:
139139
opts.show_ends = True
140140
opts.show_tabs = True

userland/utilities/chgrp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def get_new_group(opts, args: list[str]) -> tuple[int, str]:
137137

138138

139139
@core.command(parser)
140-
def python_userland_chgrp(opts, args: list[str]):
140+
def python_userland_chgrp(opts, args: list[str]) -> int:
141141
parser.expect_nargs(args, (1,))
142142

143143
from_uid: int | None = None

userland/utilities/chown.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def get_new_owner(opts, args: list[str], chown_args: dict) -> str | None:
159159

160160

161161
@core.command(parser)
162-
def python_userland_chown(opts, args: list[str]):
162+
def python_userland_chown(opts, args: list[str]) -> int:
163163
parser.expect_nargs(args, (1,))
164164

165165
from_uid: int | None = None

userland/utilities/clear.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
@core.command(parser)
17-
def python_userland_clear(opts, args: list[str]):
17+
def python_userland_clear(opts, args: list[str]) -> int:
1818
if args:
1919
return 1
2020

userland/utilities/dirname.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121

2222
@core.command(parser)
23-
def python_userland_dirname(opts, args: list[str]):
23+
def python_userland_dirname(opts, args: list[str]) -> int:
2424
parser.expect_nargs(args, (1,))
2525

2626
for path in map(PurePath, args):

userland/utilities/echo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def _process_args(self, largs, rargs, values):
5757

5858

5959
@core.command(parser)
60-
def python_userland_echo(opts, args: list[str]):
60+
def python_userland_echo(opts, args: list[str]) -> int:
6161
string = " ".join(args)
6262

6363
if opts.escapes:

userland/utilities/env.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def parse_env_args(args: list[str], env: dict[str, str], prog_args: list[str]) -
6262

6363
@core.command(parser)
6464
# pylint: disable=inconsistent-return-statements
65-
def python_userland_env(opts, args: list[str]):
65+
def python_userland_env(opts, args: list[str]) -> int:
6666
if args and args[0] == "-":
6767
opts.ignore_environment = True
6868
del args[0]

userland/utilities/factor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def format_exponents(factors: Iterable[int]) -> str:
108108

109109

110110
@core.command(parser)
111-
def python_userland_factor(opts, args: list[str]):
111+
def python_userland_factor(opts, args: list[str]) -> int:
112112
failed = False
113113

114114
try:

userland/utilities/false.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
@core.command()
8-
def python_userland_false(_, args: list[str]):
8+
def python_userland_false(_, args: list[str]) -> int:
99
if args and args[0] == "--help":
1010
print(
1111
f"""\

0 commit comments

Comments
 (0)