mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Remove .script! hack
This commit is contained in:
@@ -34,6 +34,14 @@ class TestSamples < Minitest::Test
|
||||
assert !data["interpreters"].empty?
|
||||
end
|
||||
|
||||
def test_ext_or_shebang
|
||||
Samples.each do |sample|
|
||||
if sample[:extname].to_s.empty? && !sample[:filename]
|
||||
assert sample[:interpreter], "#{sample[:path]} should have a file extension or a shebang, maybe it belongs in filenames/ subdir"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Check that there aren't samples with extensions or interpreters that
|
||||
# aren't explicitly defined in languages.yml
|
||||
languages_yml = File.expand_path("../../lib/linguist/languages.yml", __FILE__)
|
||||
@@ -42,7 +50,6 @@ class TestSamples < Minitest::Test
|
||||
options['extensions'] ||= []
|
||||
if extnames = Samples.cache['extnames'][name]
|
||||
extnames.each do |extname|
|
||||
next if extname == '.script!'
|
||||
assert options['extensions'].index { |x| x.downcase.end_with? extname.downcase }, "#{name} has a sample with extension (#{extname.downcase}) that isn't explicitly defined in languages.yml"
|
||||
end
|
||||
end
|
||||
@@ -50,8 +57,8 @@ class TestSamples < Minitest::Test
|
||||
options['interpreters'] ||= []
|
||||
if interpreters = Samples.cache['interpreters'][name]
|
||||
interpreters.each do |interpreter|
|
||||
# next if extname == '.script!'
|
||||
assert options['interpreters'].include?(interpreter), "#{name} has a sample with an interpreter (#{interpreter}) that isn't explicitly defined in languages.yml"
|
||||
assert options['interpreters'].include?(interpreter),
|
||||
"#{name} has a sample with an interpreter (#{interpreter}) that isn't explicitly defined in languages.yml"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user