mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Adding Go-specific vendor paths
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user