Skip to content

Commit

Permalink
Merge branch 'master' into associate-heuristic-with-extension
Browse files Browse the repository at this point in the history
  • Loading branch information
pchaigno committed Jul 20, 2015
2 parents 25d160e + e1dbd68 commit 452fc59
Show file tree
Hide file tree
Showing 77 changed files with 9,151 additions and 23 deletions.
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -653,3 +653,12 @@
[submodule "vendor/grammars/SMT.tmbundle"]
path = vendor/grammars/SMT.tmbundle
url = https://github.com/SRI-CSL/SMT.tmbundle.git
[submodule "vendor/grammars/language-crystal"]
path = vendor/grammars/language-crystal
url = https://github.com/k2b6s9j/language-crystal
[submodule "vendor/grammars/language-xbase"]
path = vendor/grammars/language-xbase
url = https://github.com/hernad/atom-language-harbour
[submodule "vendor/grammars/language-ncl"]
path = vendor/grammars/language-ncl
url = https://github.com/rpavlick/language-ncl.git
11 changes: 7 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Contributing

Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great. The majority of contributions won't need to touch any Ruby code at all.
[code-of-conduct]: http://todogroup.org/opencodeofconduct/#Linguist/[email protected]

Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great. This project adheres to the [Open Code of Conduct][code-of-conduct]. By participating, you are expected to uphold this code.

The majority of contributions won't need to touch any Ruby code at all.

## Adding an extension to a language

Expand Down Expand Up @@ -55,7 +58,7 @@ Syntax highlighting in GitHub is performed using TextMate-compatible grammars. T

Assuming your code is being detected as the right language, in most cases this is due to a bug in the language grammar rather than a bug in Linguist. [`grammars.yml`][grammars] lists all the grammars we use for syntax highlighting on github.com. Find the one corresponding to your code's programming language and submit a bug report upstream. If you can, try to reproduce the highlighting problem in the text editor that the grammar is designed for (TextMate, Sublime Text, or Atom) and include that information in your bug report.

You can also try to fix the bug yourself and submit a Pull Request. [TextMate's documentation](http://manual.macromates.com/en/language_grammars) offers a good introduction on how to work with TextMate-compatible grammars. You can test grammars using [Lightshow](https://github-lightshow.herokuapp.com).
You can also try to fix the bug yourself and submit a Pull Request. [TextMate's documentation](https://manual.macromates.com/en/language_grammars) offers a good introduction on how to work with TextMate-compatible grammars. You can test grammars using [Lightshow](https://github-lightshow.herokuapp.com).

Once the bug has been fixed upstream, we'll pick it up for GitHub in the next release of Linguist.

Expand All @@ -71,9 +74,9 @@ To run the tests:

bundle exec rake test

Sometimes getting the tests running can be too much work, especially if you don't have much Ruby experience. It's okay: be lazy and let our build bot [Travis](http://travis-ci.org/#!/github/linguist) run the tests for you. Just open a pull request and the bot will start cranking away.
Sometimes getting the tests running can be too much work, especially if you don't have much Ruby experience. It's okay: be lazy and let our build bot [Travis](https://travis-ci.org/#!/github/linguist) run the tests for you. Just open a pull request and the bot will start cranking away.

Here's our current build status: [![Build Status](https://secure.travis-ci.org/github/linguist.png?branch=master)](http://travis-ci.org/github/linguist)
Here's our current build status: [![Build Status](https://api.travis-ci.org/github/linguist.svg?branch=master)](https://travis-ci.org/github/linguist)


## Releasing
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace :benchmark do

corpus = File.expand_path(ENV["CORPUS"] || "samples")

require 'linguist/language'
require 'linguist'

results = Hash.new
Dir.glob("#{corpus}/**/*").each do |file|
Expand Down
7 changes: 7 additions & 0 deletions grammars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ vendor/grammars/Sublime-SQF-Language:
- source.sqf
vendor/grammars/Sublime-Text-2-OpenEdge-ABL:
- source.abl
- text.html.abl
vendor/grammars/Sublime-VimL:
- source.viml
vendor/grammars/SublimeBrainfuck:
Expand Down Expand Up @@ -314,6 +315,8 @@ vendor/grammars/language-clojure:
vendor/grammars/language-coffee-script:
- source.coffee
- source.litcoffee
vendor/grammars/language-crystal:
- source.crystal
vendor/grammars/language-csharp:
- source.cs
- source.csx
Expand All @@ -328,6 +331,8 @@ vendor/grammars/language-javascript:
vendor/grammars/language-jsoniq/:
- source.jq
- source.xq
vendor/grammars/language-ncl:
- source.ncl
vendor/grammars/language-python:
- source.python
- source.regexp.python
Expand All @@ -336,6 +341,8 @@ vendor/grammars/language-python:
vendor/grammars/language-shellscript:
- source.shell
- text.shell-session
vendor/grammars/language-xbase:
- source.harbour
vendor/grammars/language-yaml:
- source.yaml
vendor/grammars/latex.tmbundle:
Expand Down
6 changes: 6 additions & 0 deletions lib/linguist/heuristics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,12 @@ def call(data)
end
end

disambiguate ".ncl" do |data|
if data.include?("THE_TITLE")
Language["Text"]
end
end

disambiguate ".nl" do |data|
if /^(b|g)[0-9]+ /.match(data)
Language["NL"]
Expand Down
24 changes: 21 additions & 3 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ Assembly:
extensions:
- .asm
- .a51
- .inc
- .nasm
tm_scope: source.asm.x86
ace_mode: assembly_x86
Expand Down Expand Up @@ -412,6 +413,7 @@ C++:
- .hh
- .hpp
- .hxx
- .inc
- .inl
- .ipp
- .tcc
Expand Down Expand Up @@ -668,7 +670,7 @@ Crystal:
extensions:
- .cr
ace_mode: ruby
tm_scope: source.ruby
tm_scope: source.crystal
interpreters:
- crystal

Expand Down Expand Up @@ -1270,6 +1272,7 @@ HTML:
- .html
- .htm
- .html.hl
- .inc
- .st
- .xht
- .xhtml
Expand Down Expand Up @@ -1346,7 +1349,7 @@ Harbour:
color: "#0e60e3"
extensions:
- .hb
tm_scope: none
tm_scope: source.harbour
ace_mode: text

Haskell:
Expand Down Expand Up @@ -1635,6 +1638,7 @@ KiCad:
type: programming
extensions:
- .sch
- .kicad_pcb
tm_scope: none
ace_mode: text

Expand Down Expand Up @@ -2087,6 +2091,14 @@ Myghty:
tm_scope: none
ace_mode: text

NCL:
type: programming
color: #28431f
extensions:
- .ncl
tm_scope: source.ncl
ace_mode: text

NL:
type: data
extensions:
Expand Down Expand Up @@ -2380,6 +2392,7 @@ PHP:
- .aw
- .ctp
- .fcgi
- .inc
- .php3
- .php4
- .php5
Expand Down Expand Up @@ -2467,6 +2480,7 @@ Pascal:
- .pas
- .dfm
- .dpr
- .inc
- .lpr
- .pp
ace_mode: pascal
Expand Down Expand Up @@ -2986,6 +3000,7 @@ SQL:
- .sql
- .cql
- .ddl
- .inc
- .prc
- .tab
- .udf
Expand Down Expand Up @@ -3184,6 +3199,7 @@ SourcePawn:
- sourcemod
extensions:
- .sp
- .inc
- .sma
tm_scope: source.sp
ace_mode: text
Expand Down Expand Up @@ -3328,6 +3344,7 @@ Text:
extensions:
- .txt
- .fr
- .ncl
tm_scope: none
ace_mode: text

Expand Down Expand Up @@ -3775,5 +3792,6 @@ xBase:
color: "#403a40"
extensions:
- .prg
tm_scope: none
- .ch
tm_scope: source.harbour
ace_mode: text
2 changes: 1 addition & 1 deletion lib/linguist/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Linguist
VERSION = "4.5.7"
VERSION = "4.5.9"
end
Loading

0 comments on commit 452fc59

Please sign in to comment.