Skip to content

Commit

Permalink
maint: fix extract_ignored_languages; update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
yozachar committed Apr 4, 2024
1 parent a359b8d commit bc65b48
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
16 changes: 15 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 #
Expand Down

0 comments on commit bc65b48

Please sign in to comment.