mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-12-08 20:38:47 +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.
|
# Returns true or false.
|
||||||
def go_vendor?
|
def go_vendor?
|
||||||
!!name.match(/vendor\//)
|
return false unless extname == '.go'
|
||||||
|
|
||||||
|
!!name.match(/\Avendor\//)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Internal: Is the blob part of Godeps/,
|
# 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?
|
assert sample_blob("node_modules/grunt/lib/grunt.js").generated?
|
||||||
|
|
||||||
# Go vendored dependencies
|
# 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?
|
assert sample_blob("vendor/github.com/kr/s3/sign.go").generated?
|
||||||
|
refute fixture_blob("go/food_vendor/candy.go").generated?
|
||||||
|
|
||||||
# Godep saved dependencies
|
# Godep saved dependencies
|
||||||
assert sample_blob("Godeps/Godeps.json").generated?
|
assert sample_blob("Godeps/Godeps.json").generated?
|
||||||
|
|||||||
Reference in New Issue
Block a user