Skip to content

force language detection for files in .gitignore #6611

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

You must be logged in to vote

Your repo link is inaccessible.

can I force a bypass of the .gitignore restriction?

No. Linguist expects to work on files in a git repo by default and will always look first to see if the file is in a repo. If the files are in a repo but in a directory ignored by git, then Linguist (technically rugged which does the repo accessing etc) won't be able to find the files and you get the behaviour you are seeing.

This is the section of code doing this (lines 97-104):

begin
# Check if this file is inside a git repository so we have things like
# `.gitattributes` applied.
file_full_path = File.realpath(path)

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Icyrockton
Comment options

@lildude
Comment options

@Icyrockton
Comment options

Answer selected by Icyrockton
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