Add grammar for Gemfile.lock files#5266
Conversation
Before this change they were treated as Ruby files, which means the highlighting was incorrect as Gemfile.lock files have a custom format.
|
I'm not sure what to do about this test failure:
Adding |
The sample file must be placed in a "filenames" subfolder: |
lib/linguist/languages.yml
Outdated
| Ruby Gemfile.lock: | ||
| type: data | ||
| color: "#701516" | ||
| searchable: false |
There was a problem hiding this comment.
@lildude: What does searchable do? It's false on e.g. JSON but https://github.com/search?q=language:JSON&type=code works.
There was a problem hiding this comment.
Good question. I've taken a quick look into it and the answer is... wait for it... nothing 😆
It looks like that's a remnant from the old search backend that was used around about 2011-12.
I'll need to do a thorough investigation, but I think we can safely remove all the searchable stuff. I'll open an issue to remind me of this.
|
Thanks for the tip @Nixinova, that seems to have done the job. ✨ |
Description
I noticed that
Gemfile.lockfiles are currently treated as Ruby code (which they're not), which means the syntax highlighting isn't right. Here's an example.Given the prevalence of
Gemfile.lockfiles (GitHub search reports > 1M) I thought it'd be worth fixing. This PR adds a TextMate grammar forGemfile.lockfiles so we can highlight them correctly.I see this has been discussed previously, but that issue went stale and was closed. If you'd rather not include a grammar for a generated file format, no hard feelings! But in that case it'd be good to remove
Gemfile.lockfrom the file types classed as Ruby, and fix the misclassification problem described in the issue I linked 😄Right now this grammar is in its own repo as that was the path of least resistance. However I'd be more than happy to contribute it to atom/language-ruby if that'd be a better place for it.
Checklist: