Skip to main content

Practice · 3 of 3

Gitignore Guard

CHALLENGE
Difficulty: intermediate+25 XP

Write ignoreCovers(gitignoreLines, filePath): return true when any non-comment, non-empty pattern covers the path. Support: exact name (".env"), prefix glob (".env*"), directory prefix ("config/" covers "config/local.json" but NOT "config-local.json"), and wildcard ("*.log" covers "a.log", "b/c.log").

Back to lesson: Practice: Secret Detection — Practice