mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Heuristic for .inc PHP files (#2980)
This commit is contained in:
committed by
Arfon Smith
parent
03d16835aa
commit
8cf3b7ad51
@@ -187,6 +187,12 @@ module Linguist
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
disambiguate ".inc" do |data|
|
||||||
|
if /^<\?(?:php)?/.match(data)
|
||||||
|
Language["PHP"]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
disambiguate ".l" do |data|
|
disambiguate ".l" do |data|
|
||||||
if /\(def(un|macro)\s/.match(data)
|
if /\(def(un|macro)\s/.match(data)
|
||||||
Language["Common Lisp"]
|
Language["Common Lisp"]
|
||||||
|
|||||||
@@ -122,6 +122,12 @@ class TestHeuristcs < Minitest::Test
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_inc_by_heuristics
|
||||||
|
assert_heuristics({
|
||||||
|
"PHP" => all_fixtures("PHP", "*.inc")
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
def test_ls_by_heuristics
|
def test_ls_by_heuristics
|
||||||
assert_heuristics({
|
assert_heuristics({
|
||||||
"LiveScript" => all_fixtures("LiveScript", "*.ls"),
|
"LiveScript" => all_fixtures("LiveScript", "*.ls"),
|
||||||
|
|||||||
Reference in New Issue
Block a user