Skip to content

Latest commit

 

History

History
37 lines (27 loc) · 1.1 KB

File metadata and controls

37 lines (27 loc) · 1.1 KB

Linguist jsm misclassification bug

Repo created to reproduce bug github-linguist/linguist#2377

The ui.jsm is taken from here

Steps I've made

  1. Installed linguist (ubuntu 14.04).

    $ sudo gem install github-linguist
    ...
    
    Successfully installed github-linguist-4.5.4
    
    ...
    
  2. Cd to repo folder and run next commands in irb1.9.1:

    require 'rugged'
    require 'linguist'
    
    repo = Rugged::Repository.new('.')
    project = Linguist::Repository.new(repo, repo.head.target_id)
    project.language       #=> "Java"

    The output from last command should be "Javascript".

  3. After adding .gitattributes with content:

    *.jsm linguist-language=Javascript
    

    project.language returns 'Javascript' (did not commit that in repo).

Resolved (solution)

Wrong modeline was set for this file. So it is better to change Mode: Java on Mode: Javascript (github-linguist/linguist#2377 (comment)).