mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Add Carthage/Build to generated list so it doesn't show in PR diffs (#3920)
Equivalent to #3865, but for Carthage.
This commit is contained in:
@@ -53,6 +53,7 @@ module Linguist
|
|||||||
def generated?
|
def generated?
|
||||||
xcode_file? ||
|
xcode_file? ||
|
||||||
cocoapods? ||
|
cocoapods? ||
|
||||||
|
carthage_build? ||
|
||||||
generated_net_designer_file? ||
|
generated_net_designer_file? ||
|
||||||
generated_net_specflow_feature_file? ||
|
generated_net_specflow_feature_file? ||
|
||||||
composer_lock? ||
|
composer_lock? ||
|
||||||
@@ -103,6 +104,13 @@ module Linguist
|
|||||||
!!name.match(/(^Pods|\/Pods)\//)
|
!!name.match(/(^Pods|\/Pods)\//)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Internal: Is the blob part of Carthage/Build/, which contains dependencies not meant for humans in pull requests.
|
||||||
|
#
|
||||||
|
# Returns true or false.
|
||||||
|
def carthage_build?
|
||||||
|
!!name.match(/(^|\/)Carthage\/Build\//)
|
||||||
|
end
|
||||||
|
|
||||||
# Internal: Is the blob minified files?
|
# Internal: Is the blob minified files?
|
||||||
#
|
#
|
||||||
# Consider a file minified if the average line length is
|
# Consider a file minified if the average line length is
|
||||||
|
|||||||
@@ -192,6 +192,13 @@ class TestFileBlob < Minitest::Test
|
|||||||
assert sample_blob('Pods/blah').generated?
|
assert sample_blob('Pods/blah').generated?
|
||||||
assert !sample_blob('My-Pods/blah').generated?
|
assert !sample_blob('My-Pods/blah').generated?
|
||||||
|
|
||||||
|
# Carthage
|
||||||
|
assert sample_blob('Carthage/Build/blah').generated?
|
||||||
|
assert !sample_blob('Carthage/blah').generated?
|
||||||
|
assert !sample_blob('Carthage/Checkout/blah').generated?
|
||||||
|
assert !sample_blob('My-Carthage/Build/blah').generated?
|
||||||
|
assert !sample_blob('My-Carthage/Build/blah').generated?
|
||||||
|
|
||||||
# Gemfile.lock is NOT generated
|
# Gemfile.lock is NOT generated
|
||||||
assert !sample_blob("Gemfile.lock").generated?
|
assert !sample_blob("Gemfile.lock").generated?
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,14 @@ class TestGenerated < Minitest::Test
|
|||||||
generated_sample_without_loading_data("Dummy/Pods/ObjCDependency/foo.h")
|
generated_sample_without_loading_data("Dummy/Pods/ObjCDependency/foo.h")
|
||||||
generated_sample_without_loading_data("Dummy/Pods/ObjCDependency/foo.m")
|
generated_sample_without_loading_data("Dummy/Pods/ObjCDependency/foo.m")
|
||||||
|
|
||||||
|
# Carthage
|
||||||
|
generated_sample_without_loading_data("Carthage/Build/.Dependency.version")
|
||||||
|
generated_sample_without_loading_data("Carthage/Build/iOS/Dependency.framework")
|
||||||
|
generated_sample_without_loading_data("Carthage/Build/Mac/Dependency.framework")
|
||||||
|
generated_sample_without_loading_data("src/Carthage/Build/.Dependency.version")
|
||||||
|
generated_sample_without_loading_data("src/Carthage/Build/iOS/Dependency.framework")
|
||||||
|
generated_sample_without_loading_data("src/Carthage/Build/Mac/Dependency.framework")
|
||||||
|
|
||||||
# Go-specific vendored paths
|
# Go-specific vendored paths
|
||||||
generated_sample_without_loading_data("go/vendor/github.com/foo.go")
|
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/golang.org/src/foo.c")
|
||||||
|
|||||||
Reference in New Issue
Block a user