mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 09:40:21 +00:00
Only treat .go files in ^vendor/ as generated
This commit is contained in:
@@ -286,7 +286,9 @@ module Linguist
|
||||
#
|
||||
# Returns true or false.
|
||||
def go_vendor?
|
||||
!!name.match(/vendor\//)
|
||||
return false unless extname == '.go'
|
||||
|
||||
!!name.match(/\Avendor\//)
|
||||
end
|
||||
|
||||
# Internal: Is the blob part of Godeps/,
|
||||
|
||||
1
test/fixtures/go/food_vendor/candy.go
vendored
Normal file
1
test/fixtures/go/food_vendor/candy.go
vendored
Normal file
@@ -0,0 +1 @@
|
||||
// empty file for testing that paths with vendor in them don't get ingored
|
||||
@@ -246,8 +246,9 @@ class TestBlob < Minitest::Test
|
||||
assert sample_blob("node_modules/grunt/lib/grunt.js").generated?
|
||||
|
||||
# Go vendored dependencies
|
||||
assert sample_blob("vendor/vendor.json").generated?
|
||||
refute sample_blob("vendor/vendor.json").generated?
|
||||
assert sample_blob("vendor/github.com/kr/s3/sign.go").generated?
|
||||
refute fixture_blob("go/food_vendor/candy.go").generated?
|
||||
|
||||
# Godep saved dependencies
|
||||
assert sample_blob("Godeps/Godeps.json").generated?
|
||||
|
||||
Reference in New Issue
Block a user