mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Add npm-shrinkwrap.json to generated files (#3048)
This file is generated by the `npm shrinkwrap` command. It's large, generated, and has a noisey diff. One similar file, php composer lock files, is already ignored. Closes https://github.com/github/linguist/issues/3045
This commit is contained in:
committed by
Arfon Smith
parent
baf56666d4
commit
c471990aa3
@@ -56,6 +56,7 @@ module Linguist
|
|||||||
generated_net_specflow_feature_file? ||
|
generated_net_specflow_feature_file? ||
|
||||||
composer_lock? ||
|
composer_lock? ||
|
||||||
node_modules? ||
|
node_modules? ||
|
||||||
|
npm_shrinkwrap? ||
|
||||||
godeps? ||
|
godeps? ||
|
||||||
generated_by_zephir? ||
|
generated_by_zephir? ||
|
||||||
minified_files? ||
|
minified_files? ||
|
||||||
@@ -109,11 +110,11 @@ module Linguist
|
|||||||
#
|
#
|
||||||
# We assume that if one of the last 2 lines starts with a source map
|
# We assume that if one of the last 2 lines starts with a source map
|
||||||
# reference, then the current file was generated from other files.
|
# reference, then the current file was generated from other files.
|
||||||
#
|
#
|
||||||
# We use the last 2 lines because the last line might be empty.
|
# We use the last 2 lines because the last line might be empty.
|
||||||
#
|
#
|
||||||
# We only handle JavaScript, no CSS support yet.
|
# We only handle JavaScript, no CSS support yet.
|
||||||
#
|
#
|
||||||
# Returns true or false.
|
# Returns true or false.
|
||||||
def has_source_map?
|
def has_source_map?
|
||||||
return false unless extname.downcase == '.js'
|
return false unless extname.downcase == '.js'
|
||||||
@@ -303,6 +304,13 @@ module Linguist
|
|||||||
!!name.match(/node_modules\//)
|
!!name.match(/node_modules\//)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Internal: Is the blob a generated npm shrinkwrap file.
|
||||||
|
#
|
||||||
|
# Returns true or false.
|
||||||
|
def npm_shrinkwrap?
|
||||||
|
!!name.match(/npm-shrinkwrap\.json/)
|
||||||
|
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.
|
||||||
#
|
#
|
||||||
@@ -355,14 +363,14 @@ module Linguist
|
|||||||
# on the first line.
|
# on the first line.
|
||||||
#
|
#
|
||||||
# GFortran module files contain:
|
# GFortran module files contain:
|
||||||
# GFORTRAN module version 'x' created from
|
# GFORTRAN module version 'x' created from
|
||||||
# on the first line.
|
# on the first line.
|
||||||
#
|
#
|
||||||
# Return true of false
|
# Return true of false
|
||||||
def generated_module?
|
def generated_module?
|
||||||
return false unless extname == '.mod'
|
return false unless extname == '.mod'
|
||||||
return false unless lines.count > 1
|
return false unless lines.count > 1
|
||||||
return lines[0].include?("PCBNEW-LibModule-V") ||
|
return lines[0].include?("PCBNEW-LibModule-V") ||
|
||||||
lines[0].include?("GFORTRAN module version '")
|
lines[0].include?("GFORTRAN module version '")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class TestGenerated < Minitest::Test
|
|||||||
generated_loading_data(File.join(samples_path, name))
|
generated_loading_data(File.join(samples_path, name))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_check_generated
|
def test_check_generated
|
||||||
# Xcode project files
|
# Xcode project files
|
||||||
generated_sample_without_loading_data("Binary/MainMenu.nib")
|
generated_sample_without_loading_data("Binary/MainMenu.nib")
|
||||||
generated_sample_without_loading_data("Dummy/foo.xcworkspacedata")
|
generated_sample_without_loading_data("Dummy/foo.xcworkspacedata")
|
||||||
@@ -51,6 +51,9 @@ class TestGenerated < Minitest::Test
|
|||||||
# Node modules
|
# Node modules
|
||||||
generated_sample_without_loading_data("Dummy/node_modules/foo.js")
|
generated_sample_without_loading_data("Dummy/node_modules/foo.js")
|
||||||
|
|
||||||
|
# npm shrinkwrap file
|
||||||
|
generated_sample_without_loading_data("Dummy/npm-shrinkwrap.json")
|
||||||
|
|
||||||
# Godep saved dependencies
|
# Godep saved dependencies
|
||||||
generated_sample_without_loading_data("Godeps/Godeps.json")
|
generated_sample_without_loading_data("Godeps/Godeps.json")
|
||||||
generated_sample_without_loading_data("Godeps/_workspace/src/github.com/kr/s3/sign.go")
|
generated_sample_without_loading_data("Godeps/_workspace/src/github.com/kr/s3/sign.go")
|
||||||
|
|||||||
Reference in New Issue
Block a user