MCPcopy
hub / github.com/qazbnm456/awesome-web-security / entry_matches_lang

Function entry_matches_lang

scripts/generate.py:235–243  ·  view source on GitHub ↗

True if this entry should appear in the README for `lang`. An entry with `languages: [universal]` matches every language (it is rendered in all three READMEs). Otherwise the lang must be in the explicit list.

(entry: dict, lang: str)

Source from the content-addressed store, hash-verified

233
234
235def entry_matches_lang(entry: dict, lang: str) -> bool:
236 """True if this entry should appear in the README for `lang`.
237
238 An entry with `languages: [universal]` matches every language (it is
239 rendered in all three READMEs). Otherwise the lang must be in the
240 explicit list.
241 """
242 langs = entry.get("languages") or []
243 return lang in langs or "universal" in langs
244
245
246def render_section(sec: dict, entries: list[dict], lang: str) -> str:

Callers 3

render_sectionFunction · 0.85
render_readmeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected