mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Add BlobHelper#include_in_language_stats?
This just extracts some logic from Repository#compute_stats and makes it testable.
This commit is contained in:
@@ -332,5 +332,15 @@ module Linguist
|
||||
def tm_scope
|
||||
language && language.tm_scope
|
||||
end
|
||||
|
||||
DETECTABLE_TYPES = [:programming, :markup].freeze
|
||||
|
||||
# Internal: Should this blob be included in repository language statistics?
|
||||
def include_in_language_stats?
|
||||
!vendored? &&
|
||||
!documentation? &&
|
||||
!generated? &&
|
||||
language && DETECTABLE_TYPES.include?(language.type)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user