Remove unnecessary "# noqa: set_linter" comments (#159467)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/159467
Approved by: https://github.com/eellison
This commit is contained in:
Tom Ritchford
2025-08-06 18:25:16 +00:00
committed by PyTorch MergeBot
parent 289f62ce8a
commit a5725965ea
4 changed files with 5 additions and 6 deletions

View File

@ -3366,13 +3366,12 @@ def tabulate_2d(elements: Sequence[Sequence[T]], headers: Sequence[T]) -> str:
for i, e in enumerate(row):
widths[i] = max(widths[i], len(str(e)))
lines = []
# Need nested {} for string formatting; ignore SET_LINTER here
lines.append("|".join(f" {h:{w}} " for h, w in zip(headers, widths))) # noqa: set_linter
lines.append("|".join(f" {h:{w}} " for h, w in zip(headers, widths)))
# widths whitespace horizontal separators
total_width = sum(widths) + (len(widths) * 2) + (len(widths) - 1)
lines.append("-" * total_width)
for row in elements:
lines.append("|".join(f" {e:{w}} " for e, w in zip(row, widths))) # noqa: set_linter
lines.append("|".join(f" {e:{w}} " for e, w in zip(row, widths)))
return "\n".join(lines)