Skip to content

Commit

Permalink
Merge pull request github-linguist#307 from mislav/aliases
Browse files Browse the repository at this point in the history
A couple of useful language aliases
  • Loading branch information
josh committed Dec 10, 2012
2 parents b036e8d + 720914b commit ee2b92c
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 11 deletions.
68 changes: 58 additions & 10 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ Ada:
- .adb
- .ads

ApacheConf:
type: markup
aliases:
- apache
primary_extension: .conf
filenames:
- .htaccess
- httpd.conf
- apache2.conf

Apex:
type: programming
lexer: Text only
Expand Down Expand Up @@ -180,8 +190,10 @@ C++:
- cpp
primary_extension: .cpp
extensions:
- .C
- .c++
- .cxx
- .H
- .h++
- .hh
- .hxx
Expand Down Expand Up @@ -244,6 +256,7 @@ CoffeeScript:
color: "#244776"
aliases:
- coffee
- coffee-script
primary_extension: .coffee
extensions:
- ._coffee
Expand Down Expand Up @@ -545,6 +558,8 @@ Groovy Server Pages:
HTML:
type: markup
ace_mode: html
aliases:
- xhtml
primary_extension: .html
extensions:
- .htm
Expand All @@ -563,6 +578,8 @@ HTML+ERB:
type: markup
group: HTML
lexer: RHTML
aliases:
- erb
primary_extension: .erb
extensions:
- .erb
Expand All @@ -575,16 +592,9 @@ HTML+PHP:
extensions:
- .phtml

HaXe:
type: programming
lexer: haXe
ace_mode: haxe
color: "#346d51"
primary_extension: .hx
extensions:
- .hx
- .hxml
- .mtt
HTTP:
type: data
primary_extension: .http

Haml:
group: HTML
Expand All @@ -599,6 +609,15 @@ Haskell:
- .hs
- .hsc

Haxe:
type: programming
lexer: haXe
ace_mode: haxe
color: "#346d51"
primary_extension: .hx
extensions:
- .hxsl

INI:
type: data
extensions:
Expand Down Expand Up @@ -723,6 +742,8 @@ Lua:
- .nse

Makefile:
aliases:
- make
extensions:
- .mak
- .mk
Expand Down Expand Up @@ -798,6 +819,13 @@ Nemerle:
color: "#0d3c6e"
primary_extension: .n

Nginx:
type: markup
lexer: Nginx configuration file
primary_extension: .conf
filenames:
- nginx.conf

Nimrod:
type: programming
color: "#37775b"
Expand Down Expand Up @@ -843,13 +871,18 @@ ObjDump:
Objective-C:
type: programming
color: "#438eff"
aliases:
- obj-c
- objc
primary_extension: .m
extensions:
- .mm

Objective-J:
type: programming
color: "#ff0c5a"
aliases:
- obj-j
primary_extension: .j
extensions:
- .j
Expand Down Expand Up @@ -1126,7 +1159,13 @@ Shell:
primary_extension: .sh
filenames:
- .zsh
- bash_logout
- bash_profile
- bashrc
- zlogin
- zlogout
- zshenv
- zprofile
- zshrc

Smalltalk:
Expand Down Expand Up @@ -1172,6 +1211,8 @@ Tcsh:
TeX:
type: markup
ace_mode: latex
aliases:
- latex
primary_extension: .tex
extensions:
- .aux
Expand Down Expand Up @@ -1261,6 +1302,11 @@ Visual Basic:
XML:
type: markup
ace_mode: xml
aliases:
- rss
- xsd
- xsl
- wsdl
primary_extension: .xml
extensions:
- .glade
Expand Down Expand Up @@ -1306,6 +1352,8 @@ XSLT:

YAML:
type: markup
aliases:
- yml
primary_extension: .yml
extensions:
- .yaml
Expand Down
15 changes: 14 additions & 1 deletion test/test_language.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def test_lexer
assert_equal Lexer['HTML'], Language['HTML'].lexer
assert_equal Lexer['HTML+Django/Jinja'], Language['HTML+Django'].lexer
assert_equal Lexer['HTML+PHP'], Language['HTML+PHP'].lexer
assert_equal Lexer['HTTP'], Language['HTTP'].lexer
assert_equal Lexer['JSON'], Language['JSON'].lexer
assert_equal Lexer['Java'], Language['ChucK'].lexer
assert_equal Lexer['Java'], Language['Java'].lexer
Expand All @@ -51,7 +52,7 @@ def test_lexer
assert_equal Lexer['Verilog'], Language['Verilog'].lexer
assert_equal Lexer['XSLT'], Language['XSLT'].lexer
assert_equal Lexer['aspx-vb'], Language['ASP'].lexer
assert_equal Lexer['haXe'], Language['HaXe'].lexer
assert_equal Lexer['haXe'], Language['Haxe'].lexer
assert_equal Lexer['reStructuredText'], Language['reStructuredText'].lexer
end

Expand All @@ -60,6 +61,7 @@ def test_find_by_alias
assert_equal Language['ASP'], Language.find_by_alias('aspx')
assert_equal Language['ASP'], Language.find_by_alias('aspx-vb')
assert_equal Language['ActionScript'], Language.find_by_alias('as3')
assert_equal Language['ApacheConf'], Language.find_by_alias('apache')
assert_equal Language['Assembly'], Language.find_by_alias('nasm')
assert_equal Language['Batchfile'], Language.find_by_alias('bat')
assert_equal Language['C#'], Language.find_by_alias('c#')
Expand All @@ -68,6 +70,7 @@ def test_find_by_alias
assert_equal Language['C++'], Language.find_by_alias('c++')
assert_equal Language['C++'], Language.find_by_alias('cpp')
assert_equal Language['CoffeeScript'], Language.find_by_alias('coffee')
assert_equal Language['CoffeeScript'], Language.find_by_alias('coffee-script')
assert_equal Language['ColdFusion'], Language.find_by_alias('cfm')
assert_equal Language['Common Lisp'], Language.find_by_alias('common-lisp')
assert_equal Language['Common Lisp'], Language.find_by_alias('lisp')
Expand All @@ -78,7 +81,9 @@ def test_find_by_alias
assert_equal Language['Emacs Lisp'], Language.find_by_alias('emacs-lisp')
assert_equal Language['Gettext Catalog'], Language.find_by_alias('pot')
assert_equal Language['HTML'], Language.find_by_alias('html')
assert_equal Language['HTML'], Language.find_by_alias('xhtml')
assert_equal Language['HTML+ERB'], Language.find_by_alias('html+erb')
assert_equal Language['HTML+ERB'], Language.find_by_alias('erb')
assert_equal Language['IRC log'], Language.find_by_alias('irc')
assert_equal Language['JSON'], Language.find_by_alias('json')
assert_equal Language['Java Server Pages'], Language.find_by_alias('jsp')
Expand All @@ -87,6 +92,7 @@ def test_find_by_alias
assert_equal Language['JavaScript'], Language.find_by_alias('js')
assert_equal Language['Literate Haskell'], Language.find_by_alias('lhs')
assert_equal Language['Literate Haskell'], Language.find_by_alias('literate-haskell')
assert_equal Language['Objective-C'], Language.find_by_alias('objc')
assert_equal Language['OpenEdge ABL'], Language.find_by_alias('openedge')
assert_equal Language['OpenEdge ABL'], Language.find_by_alias('progress')
assert_equal Language['OpenEdge ABL'], Language.find_by_alias('abl')
Expand All @@ -106,6 +112,7 @@ def test_find_by_alias
assert_equal Language['VimL'], Language.find_by_alias('vim')
assert_equal Language['VimL'], Language.find_by_alias('viml')
assert_equal Language['reStructuredText'], Language.find_by_alias('rst')
assert_equal Language['YAML'], Language.find_by_alias('yml')
end

def test_groups
Expand Down Expand Up @@ -224,10 +231,16 @@ def test_find_by_filename
assert_equal [Language['Ruby']], Language.find_by_filename('foo/bar.rb')
assert_equal [Language['Ruby']], Language.find_by_filename('Rakefile')
assert_equal [Language['Ruby']], Language.find_by_filename('PKGBUILD.rb')
assert_equal Language['ApacheConf'], Language.find_by_filename('httpd.conf').first
assert_equal [Language['ApacheConf']], Language.find_by_filename('.htaccess')
assert_equal Language['Nginx'], Language.find_by_filename('nginx.conf').first
assert_equal ['C', 'C++', 'Objective-C'], Language.find_by_filename('foo.h').map(&:name).sort
assert_equal [], Language.find_by_filename('rb')
assert_equal [], Language.find_by_filename('.rb')
assert_equal [], Language.find_by_filename('.nkt')
assert_equal [Language['Shell']], Language.find_by_filename('.bashrc')
assert_equal [Language['Shell']], Language.find_by_filename('bash_profile')
assert_equal [Language['Shell']], Language.find_by_filename('.zshrc')
end

def test_find
Expand Down

0 comments on commit ee2b92c

Please sign in to comment.