diff --git a/lib/linguist/generated.rb b/lib/linguist/generated.rb index 99863a91..0f911c45 100644 --- a/lib/linguist/generated.rb +++ b/lib/linguist/generated.rb @@ -63,6 +63,7 @@ module Linguist generated_jni_header? || composer_lock? || node_modules? || + godeps? || vcr_cassette? || generated_by_zephir? end @@ -231,6 +232,14 @@ module Linguist !!name.match(/node_modules\//) end + # Internal: Is the blob part of Godeps/, + # which are not meant for humans in pull requests. + # + # Returns true or false. + def godeps? + !!name.match(/Godeps\//) + end + # Internal: Is the blob a generated php composer lock file? # # Returns true or false. diff --git a/lib/linguist/vendor.yml b/lib/linguist/vendor.yml index 270ad593..6c87f10a 100644 --- a/lib/linguist/vendor.yml +++ b/lib/linguist/vendor.yml @@ -33,6 +33,9 @@ # Erlang bundles - ^rebar$ +# Go dependencies +- Godeps/_workspace/ + # Bootstrap minified css and js - (^|/)bootstrap([^.]*)(\.min)?\.(js|css)$ diff --git a/test/test_blob.rb b/test/test_blob.rb index 968abf09..7c5a756a 100644 --- a/test/test_blob.rb +++ b/test/test_blob.rb @@ -262,6 +262,10 @@ class TestBlob < Test::Unit::TestCase assert Linguist::Generated.generated?("node_modules/grunt/lib/grunt.js", nil) + + # Godep saved dependencies + assert blob("Godeps/Godeps.json").generated? + assert blob("Godeps/_workspace/src/github.com/kr/s3/sign.go").generated? end def test_vendored @@ -279,6 +283,10 @@ class TestBlob < Test::Unit::TestCase assert blob("app/bower_components/custom/custom.js").vendored? assert blob("vendor/assets/bower_components/custom/custom.js").vendored? + # Go dependencies + assert !blob("Godeps/Godeps.json").vendored? + assert blob("Godeps/_workspace/src/github.com/kr/s3/sign.go").vendored? + # Rails vendor/ assert blob("vendor/plugins/will_paginate/lib/will_paginate.rb").vendored?