Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncozens committed Sep 2, 2024
1 parent d69513e commit b83b2be
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
5 changes: 4 additions & 1 deletion Lib/shaperglot/checks/shaping_differs.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ def execute(self, checker) -> None:
checker.results.fail(
check_name="shaping-differs",
result_code="too-few-glyphs",
message=f"Test asked for glyph {glyph_ix} but shaper only returned {len(buffer)} glyphs",
message=(
f"Test asked for glyph {glyph_ix} but "
f"shaper only returned {len(buffer)} glyphs"
),
context={
"input1": self.inputs[0].check_yaml,
"input2": self.inputs[0].check_yaml,
Expand Down
4 changes: 2 additions & 2 deletions Lib/shaperglot/cli/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ def check(options) -> None:
show_how_to_fix(fixes_needed)


def show_how_to_fix(fixes: Reporter):
def show_how_to_fix(reporter: Reporter):
print("\nTo add full support to nearly-supported languages:")
for category, fixes in fixes.items():
for category, fixes in reporter.items():
plural = "s" if len(fixes) > 1 else ""
print(f" * {category.replace("_", ' ').capitalize()}{plural}: ", end="")
print("; ".join(sorted(fixes)))
1 change: 0 additions & 1 deletion Lib/shaperglot/cli/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ def report(options) -> None:
"""Report which languages are supported by the given font"""
checker = Checker(options.font)
langs = Languages()
messages = []
nearly = []
supported = []
unsupported = []
Expand Down
3 changes: 1 addition & 2 deletions Lib/shaperglot/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from collections.abc import Sequence
from dataclasses import dataclass, field
from enum import Enum
import json
from typing import Dict

from termcolor import colored
Expand Down Expand Up @@ -94,4 +93,4 @@ def unique_fixes(self) -> Dict[str, list[str]]:
def count_fixes(self) -> int:
"""Return the number of fixes required to pass all checks"""
fixes = self.unique_fixes()
return sum([len(stuff) for stuff in fixes.values()])
return sum(len(stuff) for stuff in fixes.values())

0 comments on commit b83b2be

Please sign in to comment.