Skip to content

Commit

Permalink
Heuristic rule for Hack .hh files (#4347)
Browse files Browse the repository at this point in the history
  • Loading branch information
pchaigno authored Dec 10, 2018
1 parent e6a4a0e commit 1cc86b6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/linguist/heuristics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ disambiguations:
named_pattern: objectivec
- language: C++
named_pattern: cpp
- extensions: ['.hh']
rules:
- language: Hack
pattern: '<\?hh'
- extensions: ['.ice']
rules:
- language: Slice
Expand Down
7 changes: 7 additions & 0 deletions test/test_heuristics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,13 @@ def test_h_by_heuristics
})
end

# Candidate languages = ["C++", "Hack"]
def test_hh_by_heuristics
assert_heuristics({
"Hack" => all_fixtures("Hack", "*.hh"),
})
end

def test_ice_by_heuristics
assert_heuristics({
"Slice" => all_fixtures("Slice", "*.ice"),
Expand Down

0 comments on commit 1cc86b6

Please sign in to comment.