Skip to content

Commit 89682cf

Browse files
committed
Fix all ty errors
1 parent b2e7926 commit 89682cf

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

.github/scripts/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ pylint fire --ignore=test_components_py3.py,parser_fuzz_test.py,console
2727
if [[ ${PYTHON_VERSION} == 3.12 ]]; then
2828
# Run type-checking
2929
pip install uv
30-
uvx ty check --exclude fire/test_components_py3.py
30+
uvx ty check --exclude fire/test_components_py3.py --exclude fire/console/ --exclude fire/formatting_windows.py
3131
fi

fire/console/console_attr_os.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def _GetXY(fd):
7373
try:
7474
# This magic incantation converts a struct from ioctl(2) containing two
7575
# binary shorts to a (rows, columns) int tuple.
76-
rc = struct.unpack(b'hh', fcntl.ioctl(fd, termios.TIOCGWINSZ, 'junk'))
76+
rc = struct.unpack(b'hh', fcntl.ioctl(fd, termios.TIOCGWINSZ, b'junk'))
7777
return (rc[1], rc[0]) if rc else None
7878
except: # pylint: disable=bare-except
7979
return None

fire/helptext.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,10 @@ def HelpText(component, trace=None, verbose=False):
8787
+ usage_details_sections
8888
+ notes_sections
8989
)
90+
valid_sections = [section for section in sections if section is not None]
9091
return '\n\n'.join(
91-
_CreateOutputSection(*section)
92-
for section in sections if section is not None
92+
_CreateOutputSection(name, content)
93+
for name, content in valid_sections
9394
)
9495

9596

@@ -283,7 +284,7 @@ def _ArgsAndFlagsSections(info, spec, metadata):
283284
return args_and_flags_sections, notes_sections
284285

285286

286-
def _UsageDetailsSections(component, actions_grouped_by_kind):
287+
def _UsageDetailsSections(component, actions_grouped_by_kind) -> list[tuple[str, str]]:
287288
"""The usage details sections of the help string."""
288289
groups, commands, values, indexes = actions_grouped_by_kind
289290

pyproject.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,3 @@ addopts = [
6363
"--ignore=fire/test_components_py3.py",
6464
"--ignore=fire/parser_fuzz_test.py"
6565
]
66-
67-
[tool.ty]
68-
# ty configuration - using defaults for now

0 commit comments

Comments
 (0)