mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Exclude files over 0.1MB from searches
This commit is contained in:
@@ -209,13 +209,16 @@ module Linguist
|
|||||||
# Public: Should the blob be indexed for searching?
|
# Public: Should the blob be indexed for searching?
|
||||||
#
|
#
|
||||||
# Excluded:
|
# Excluded:
|
||||||
|
# - Files over 0.1MB
|
||||||
# - Non-text files
|
# - Non-text files
|
||||||
# - Generated source files
|
# - Generated source files
|
||||||
# - .po and .sql files
|
# - .po and .sql files
|
||||||
#
|
#
|
||||||
# Return true or false
|
# Return true or false
|
||||||
def indexable?
|
def indexable?
|
||||||
if !text?
|
if size > 100 * 1024
|
||||||
|
false
|
||||||
|
elsif !text?
|
||||||
false
|
false
|
||||||
elsif generated?
|
elsif generated?
|
||||||
false
|
false
|
||||||
|
|||||||
Reference in New Issue
Block a user