mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Only recognise Pod for .pod files (#3863)
We uncomplicate matters by removing ".pod" from the Perl definition entirely.
This commit is contained in:
@@ -367,14 +367,6 @@ module Linguist
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
disambiguate ".pod", "Pod", "Perl" do |data|
|
|
||||||
if /^=\w+\b/.match(data)
|
|
||||||
Language["Pod"]
|
|
||||||
else
|
|
||||||
Language["Perl"]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
disambiguate ".pro" do |data|
|
disambiguate ".pro" do |data|
|
||||||
if /^[^#]+:-/.match(data)
|
if /^[^#]+:-/.match(data)
|
||||||
Language["Prolog"]
|
Language["Prolog"]
|
||||||
|
|||||||
@@ -3313,7 +3313,6 @@ Perl:
|
|||||||
- ".ph"
|
- ".ph"
|
||||||
- ".plx"
|
- ".plx"
|
||||||
- ".pm"
|
- ".pm"
|
||||||
- ".pod"
|
|
||||||
- ".psgi"
|
- ".psgi"
|
||||||
- ".t"
|
- ".t"
|
||||||
filenames:
|
filenames:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require_relative "./helper"
|
require_relative "./helper"
|
||||||
|
|
||||||
class TestHeuristcs < Minitest::Test
|
class TestHeuristics < Minitest::Test
|
||||||
include Linguist
|
include Linguist
|
||||||
|
|
||||||
def fixture(name)
|
def fixture(name)
|
||||||
@@ -237,14 +237,6 @@ class TestHeuristcs < Minitest::Test
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
# Candidate languages = ["Pod", "Perl"]
|
|
||||||
def test_pod_by_heuristics
|
|
||||||
assert_heuristics({
|
|
||||||
"Perl" => all_fixtures("Perl", "*.pod"),
|
|
||||||
"Pod" => all_fixtures("Pod", "*.pod")
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
# Candidate languages = ["IDL", "Prolog", "QMake", "INI"]
|
# Candidate languages = ["IDL", "Prolog", "QMake", "INI"]
|
||||||
def test_pro_by_heuristics
|
def test_pro_by_heuristics
|
||||||
assert_heuristics({
|
assert_heuristics({
|
||||||
|
|||||||
Reference in New Issue
Block a user