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"""\

userland/utilities/groups.py

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

1313

1414
@core.command(parser)
15-
def python_userland_groups(_, args):
15+
def python_userland_groups(_, args) -> int:
1616
failed = False
1717

1818
for user in args or [os.getlogin()]:

userland/utilities/hostid.py

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

1010

1111
@core.command(parser)
12-
def python_userland_hostid(_, args):
12+
def python_userland_hostid(_, args) -> int:
1313
parser.expect_nargs(args, 0)
1414

1515
# We're not the only ones being lazy here... musl libc's gethostid(3)

userland/utilities/id.py

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

4545

4646
@core.command(parser)
47-
def python_userland_id(opts, args: list[str]):
47+
def python_userland_id(opts, args: list[str]) -> int:
4848
if opts.context:
4949
parser.error("--context (-Z) is not supported")
5050

userland/utilities/logname.py

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

1111

1212
@core.command(parser)
13-
def python_userland_logname(_, args):
13+
def python_userland_logname(_, args) -> int:
1414
parser.expect_nargs(args, 0)
1515

1616
print(os.getlogin())

userland/utilities/nologin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88

99

1010
@core.command(parser)
11-
def python_userland_nologin(*_):
11+
def python_userland_nologin(*_) -> int:
1212
print("This account is currently not available.")
1313
return 1

userland/utilities/nproc.py

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

2525

2626
@core.command(parser)
27-
def python_userland_nproc(opts, args: list[str]):
27+
def python_userland_nproc(opts, args: list[str]) -> int:
2828
parser.expect_nargs(args, 0)
2929

3030
n_cpus = os.cpu_count() if opts.all else os.process_cpu_count()

userland/utilities/printenv.py

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

1313

1414
@core.command(parser)
15-
def python_userland_printenv(opts, var_names: list[str]):
15+
def python_userland_printenv(opts, var_names: list[str]) -> int:
1616
endchar = "\0" if opts.null else "\n"
1717

1818
if not var_names:

userland/utilities/pwd.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_pwd(opts, args: list[str]):
29+
def python_userland_pwd(opts, args: list[str]) -> int:
3030
if args:
3131
parser.error("too many arguments")
3232

userland/utilities/readlink.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def readlink_function(
8383

8484

8585
@core.command(parser)
86-
def python_userland_readlink(opts, args: list[str]):
86+
def python_userland_readlink(opts, args: list[str]) -> int:
8787
parser.expect_nargs(args, (1,))
8888

8989
if opts.no_newline and len(args) > 1:

userland/utilities/realpath.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def resolve_filename(opts, name: str) -> str:
9898

9999

100100
@core.command(parser)
101-
def python_userland_realpath(opts, args: list[str]):
101+
def python_userland_realpath(opts, args: list[str]) -> int:
102102
parser.expect_nargs(args, (1,))
103103

104104
endchar = "\0" if opts.zero else "\n"

userland/utilities/reset.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_reset(opts, args: list[str]):
29+
def python_userland_reset(opts, args: list[str]) -> int:
3030
if args and args[0] == "-":
3131
opts.q = True
3232
del args[0]

userland/utilities/seq.py

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

3737

3838
@core.command(parser)
39-
def python_userland_seq(opts, args: list[str]):
39+
def python_userland_seq(opts, args: list[str]) -> int:
4040
parser.expect_nargs(args, (1, 3))
4141

4242
if opts.format and opts.equal_width:

userland/utilities/sleep.py

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

1818

1919
@core.command(parser)
20-
def python_userland_sleep(_, args):
20+
def python_userland_sleep(_, args) -> int:
2121
total_secs = Decimal()
2222

2323
for spec in args:

userland/utilities/sum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def sum_sysv(data: bytes) -> str:
4747

4848

4949
@core.command(parser)
50-
def python_userland_sum(opts, args: list[str]):
50+
def python_userland_sum(opts, args: list[str]) -> int:
5151
failed = False
5252

5353
for name in args or ["-"]:

userland/utilities/sync.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_sync(opts, args: list[str]):
29+
def python_userland_sync(opts, args: list[str]) -> int:
3030
if not args:
3131
os.sync()
3232
return 0

userland/utilities/true.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_true(_, args: list[str]):
8+
def python_userland_true(_, args: list[str]) -> int:
99
if args and args[0] == "--help":
1010
print(
1111
f"""\

userland/utilities/truncate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def get_size_changer(prefix: str | None, num: int | None) -> Callable[[int], int
6363

6464

6565
@core.command(parser)
66-
def python_userland_truncate(opts, args: list[str]):
66+
def python_userland_truncate(opts, args: list[str]) -> int:
6767
if opts.reference:
6868
opts.reference = Path(opts.reference)
6969

userland/utilities/tty.py

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

2020

2121
@core.command(parser)
22-
def python_userland_tty(opts, args: list[str]):
22+
def python_userland_tty(opts, args: list[str]) -> int:
2323
parser.expect_nargs(args, 0)
2424

2525
try:

userland/utilities/uname.py

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

7676

7777
@core.command(parser)
78-
def python_userland_uname(opts, args: list[str]):
78+
def python_userland_uname(opts, args: list[str]) -> int:
7979
parser.expect_nargs(args, 0)
8080

8181
extras: list[str] = []

userland/utilities/whoami.py

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

1111

1212
@core.command(parser)
13-
def python_userland_whoami(_, args):
13+
def python_userland_whoami(_, args) -> int:
1414
parser.expect_nargs(args, 0)
1515

1616
print(os.getlogin())

userland/utilities/yes.py

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

99

1010
@core.command(parser)
11-
def python_userland_yes(_, args):
11+
def python_userland_yes(_, args) -> int:
1212
try:
1313
string = " ".join(args or ["y"])
1414
while True:

0 commit comments

Comments
 (0)