From bc65b48ca263d7cc8052b06b028bd589c9a59f90 Mon Sep 17 00:00:00 2001 From: Jovial Joe Jayarson Date: Thu, 4 Apr 2024 13:16:19 +0530 Subject: [PATCH] maint: fix `extract_ignored_languages`; update deps --- main.py | 16 +++++++++++++++- pyproject.toml | 4 ++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index ed87efc..64098b3 100644 --- a/main.py +++ b/main.py @@ -271,6 +271,20 @@ def make_graph(block_style: str, percent: float, gr_len: int, lg_nm: str = "", / return graph_bar +def _extract_ignored_languages(): + if not wk_i.ignored_languages: + return False + temp = "" + for igl in wk_i.ignored_languages.strip().split(): + if igl.startswith('"'): + temp = igl + continue + if igl.endswith('"'): + igl = f"{temp} {igl}" + temp = "" + yield igl + + def prep_content(stats: dict[str, Any], /): """WakaReadme Prepare Markdown. @@ -315,7 +329,7 @@ def prep_content(stats: dict[str, Any], /): ) return contents.rstrip("\n") - ignored_languages = set[str](igl.lower() for igl in wk_i.ignored_languages.strip().split()) + ignored_languages = _extract_ignored_languages() for idx, lang in enumerate(lang_info): lang_name = str(lang["name"]) if ignored_languages and lang_name.lower() in ignored_languages: diff --git a/pyproject.toml b/pyproject.toml index 37650b6..02ae339 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ classifiers = [ "Typing :: Typed", ] requires-python = ">=3.12" -dependencies = ["faker>=22.6.0", "pygithub>=2.1.1", "requests>=2.31.0"] +dependencies = ["faker>=24.4.0", "pygithub>=2.3.0", "requests>=2.31.0"] [project.urls] Homepage = "https://github.com/athul/waka-readme" @@ -36,7 +36,7 @@ extra = ["loguru>=0.7.2", "python-dotenv>=1.0.1"] ############################# [tool.pdm.dev-dependencies] -tooling = ["bandit>=1.7.7", "black>=24.1.1", "ruff>=0.1.15", "pyright>=1.1.349"] +tooling = ["bandit>=1.7.8", "black>=24.3.0", "ruff>=0.3.5", "pyright>=1.1.357"] #################### # Configurations #