Skip to content

Repo to check for wrong classification of javascript files with .jsm extention as being java files

Notifications You must be signed in to change notification settings

oshybystyi/Linguist-jsm-misclassification-bug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

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)).

About

Repo to check for wrong classification of javascript files with .jsm extention as being java files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages