Hello,
The utils.glob_to_pattern function, which converts glob patterns to Lua regex for file searching, has a flaw in its implementation that leads to incorrect file matching.
* is translated incorrectly: The glob * is converted to the Lua pattern .*. This is incorrect because * should not match directory separators (/), but . does. This causes patterns like *.lua to incorrectly match files in subdirectories (e.g., lua/utils.lua).
** is not handled correctly: The glob ** is not specially handled and is treated as two separate *s. This results in an incorrect pattern that does not properly match across multiple directory levels as intended.
I am working on a PR.
Hello,
The
utils.glob_to_patternfunction, which converts glob patterns to Lua regex for file searching, has a flaw in its implementation that leads to incorrect file matching.*is translated incorrectly: The glob*is converted to the Lua pattern.*. This is incorrect because*should not match directory separators (/), but.does. This causes patterns like*.luato incorrectly match files in subdirectories (e.g.,lua/utils.lua).**is not handled correctly: The glob**is not specially handled and is treated as two separate*s. This results in an incorrect pattern that does not properly match across multiple directory levels as intended.I am working on a PR.