Add Go dependencies to generated.rb and test_blob.rb

This commit is contained in:
Keith Rarick
2015-09-03 10:27:28 -07:00
parent 61102812a0
commit 3c5bcb434c
2 changed files with 13 additions and 0 deletions

View File

@@ -56,6 +56,7 @@ module Linguist
generated_net_specflow_feature_file? || generated_net_specflow_feature_file? ||
composer_lock? || composer_lock? ||
node_modules? || node_modules? ||
go_vendor? ||
godeps? || godeps? ||
generated_by_zephir? || generated_by_zephir? ||
minified_files? || minified_files? ||
@@ -280,6 +281,14 @@ module Linguist
!!name.match(/node_modules\//) !!name.match(/node_modules\//)
end end
# Internal: Is the blob part of the Go vendor/ tree,
# not meant for humans in pull requests.
#
# Returns true or false.
def go_vendor?
!!name.match(/vendor\//)
end
# Internal: Is the blob part of Godeps/, # Internal: Is the blob part of Godeps/,
# which are not meant for humans in pull requests. # which are not meant for humans in pull requests.
# #

View File

@@ -245,6 +245,10 @@ 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
assert sample_blob("vendor/vendor.json").generated?
assert sample_blob("vendor/github.com/kr/s3/sign.go").generated?
# Godep saved dependencies # Godep saved dependencies
assert sample_blob("Godeps/Godeps.json").generated? assert sample_blob("Godeps/Godeps.json").generated?
assert sample_blob("Godeps/_workspace/src/github.com/kr/s3/sign.go").generated? assert sample_blob("Godeps/_workspace/src/github.com/kr/s3/sign.go").generated?