Skip to content

Linguist doesn't recognize code in github-pages #6281

Answered by lildude
JohnyP36 asked this question in Q&A
Discussion options

You must be logged in to vote

You only need one line and it needs to look like this

docs/** -linguist-documentation

Why? Because docs/ is not recursive so the override would only apply to that directory. Using docs/* would apply the override only to the files within docs/ but not any of its subdirectories, hence we need docs/** to recurse all the way down.

This is not specific to Linguist. It's how the path matching works with .gitattributes as detailed in the .gitattributes docs:

The rules by which the pattern matches paths are the same as in .gitignore files (see gitignore[5]), with a few exceptions:

  • negative patterns are forbidden
  • patterns that match a directory do not recursively match paths inside that director…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@JohnyP36
Comment options

Answer selected by JohnyP36
Comment options

You must be logged in to vote
1 reply
@lildude
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants