Adding Go-specific vendor paths

This commit is contained in:
Arfon Smith
2016-10-27 13:59:09 -04:00
parent 4efc6f8c95
commit a29f5b2d46
2 changed files with 6 additions and 3 deletions

View File

@@ -310,9 +310,7 @@ module Linguist
#
# Returns true or false.
def go_vendor?
return false unless extname == '.go'
!!name.match(/\Avendor\//)
!!name.match(/vendor\/((?!-)[-0-9A-Za-z]+(?<!-)\.)+(com|edu|gov|in|me|net|org|fm|io)/)
end
# Internal: Is the blob a generated npm shrinkwrap file.

View File

@@ -42,6 +42,11 @@ class TestGenerated < Minitest::Test
generated_sample_without_loading_data("Dummy/foo.xcworkspacedata")
generated_sample_without_loading_data("Dummy/foo.xcuserstate")
# Go-specific vendored paths
generated_sample_without_loading_data("go/vendor/github.com/foo.go")
generated_sample_without_loading_data("go/vendor/golang.org/src/foo.c")
generated_sample_without_loading_data("go/vendor/gopkg.in/some/nested/path/foo.go")
# .NET designer file
generated_sample_without_loading_data("Dummu/foo.designer.cs")