Search code examples
githubgithub-linguist

Does GitHub Linguist support prefix wildcards for linguist-vendored?


In GitHub's documentation on linguist, the section on using the .gitattributes file says a path can be marked as vendored, and thus ignored in the repository's statistics tracking, with:

special-vendored-path/* linguist-vendored

However, is it possible to have linguist mark directories as vendored that may be nested in directories containing non-vendored code?

I tried adding a line styled as */special-vendored-path/* linguist-vendored to my .gitattributes, but that didn't cause the GitHub code-proportion information to change.


Solution

  • To match a directory inside an arbitrary arborescence of directories, you need double asterisks:

    **/special-vendored-path/* linguist-vendored
    

    Note, however, that double asterisks are not needed at the end of paths. For example, test1/* will match test1/test2/test3/file.