diff --git a/scripts/liblilex/build/build.py b/scripts/liblilex/build/build.py index fe5fde62..23892bd4 100644 --- a/scripts/liblilex/build/build.py +++ b/scripts/liblilex/build/build.py @@ -1,3 +1,4 @@ +"""Glyphs builder""" import asyncio import os from shutil import rmtree diff --git a/scripts/liblilex/build/post_process.py b/scripts/liblilex/build/post_process.py index 3340a931..5fdb6237 100644 --- a/scripts/liblilex/build/post_process.py +++ b/scripts/liblilex/build/post_process.py @@ -36,7 +36,8 @@ async def _fix_variable(files: list[str]): for file in files: fix_tasks.append(_fix_font(file)) await asyncio.gather(*fix_tasks) - config = load(open(STAT_CONFIG, encoding="utf-8"), Loader=SafeLoader) + with open(STAT_CONFIG, "r", encoding="utf-8") as file: + config = load(file, Loader=SafeLoader) fonts = [TTFont(f) for f in files] gen_stat_tables_from_config(config, fonts, has_italic=True) for font in fonts: diff --git a/scripts/liblilex/features/tpl.py b/scripts/liblilex/features/tpl.py index 5f2c2957..573b9eb3 100644 --- a/scripts/liblilex/features/tpl.py +++ b/scripts/liblilex/features/tpl.py @@ -1,3 +1,4 @@ +"""Feature templates""" NAME_TPL = { "ss": ( "featureNames {\n" diff --git a/scripts/porting.py b/scripts/porting.py index ac990443..323ce56f 100755 --- a/scripts/porting.py +++ b/scripts/porting.py @@ -38,7 +38,7 @@ def progress(args): stored_glyphs = json.load(file) diff = len(stored_glyphs) - len(missing_glyphs) - progress_value = (diff / len(stored_glyphs)) + progress_value = diff / len(stored_glyphs) if not args.markdown: for glyph in missing_glyphs: print(f"- {glyph}") @@ -53,7 +53,7 @@ def progress(args): if suffix is None: groups[group].append(glyph) continue - elif suffix in glyph: + if suffix in glyph: if group not in groups: groups[group] = [] groups[group].append(glyph)