topfreegames/codeowners-verifier

Validation of declared files/pattern don't cover all cases

Closed this issue · 0 comments

Our current Glob library doesn't validate correctly the following .gitignore rules:

If there is a separator at the beginning or middle (or both) of the pattern, then the pattern is relative to the directory level of the particular .gitignore file itself. Otherwise the pattern may also match at any level below the .gitignore level.

If there is a separator at the end of the pattern then the pattern will only match directories, otherwise the pattern can match both files and directories.

For example, a pattern doc/frotz/ matches doc/frotz directory, but not a/doc/frotz directory; however frotz/ matches frotz and a/frotz that is a directory (all paths are relative from the .gitignore file).

Some examples that didn't get validated correctly were:

/*.* @test1
/.gitlab/** @test2