linguist icon indicating copy to clipboard operation
linguist copied to clipboard

Add support for Elvish

Open xiaq opened this issue 2 years ago • 3 comments

Usage in the wild: https://github.com/search?q=extension%3Aelv&type=Code&ref=advsearch&l=&l=. There are a couple of false positives, but the vast majority of the results are Elvish scripts.

Code sample is taken from Elvish's standard library: https://github.com/elves/elvish/blob/master/pkg/mods/epm/epm.elv, license BSD 2-clause.

Description

Checklist:

  • [ ] I am associating a language with a new file extension.

    • [ ] The new extension is used in hundreds of repositories on GitHub.com
      • Search results for each extension:
        • https://github.com/search?q=extension%3Aelv&type=Code&ref=advsearch&l=&l=
    • [ ] I have included a real-world usage sample for all extensions added in this PR:
      • Sample source(s):
        • https://github.com/elves/elvish/blob/master/pkg/mods/epm/epm.elv
      • Sample license(s): BSD 2-clause
    • [ ] I have included a change to the heuristics to distinguish my language from others using the same extension.
  • [x] I am adding a new language.

    • [x] The extension of the new language is used in hundreds of repositories on GitHub.com.
      • Search results for each extension:
        • https://github.com/search?q=extension%3Aelv&type=Code&ref=advsearch&l=&l=
    • [x] I have included a real-world usage sample for all extensions added in this PR:
      • Sample source(s):
        • https://github.com/elves/elvish/blob/master/pkg/mods/epm/epm.elv
      • Sample license(s): BSD 2-clause
    • [x] I have included a syntax highlighting grammar: https://github.com/elves/elvish
    • [ ] I have updated the heuristics to distinguish my language from others using the same extension.
  • [ ] I am fixing a misclassified language

    • [ ] I have included a new sample for the misclassified language:
      • Sample source(s):
        • [URL to each sample source, if applicable]
      • Sample license(s):
    • [ ] I have included a change to the heuristics to distinguish my language from others using the same extension.
  • [ ] I am changing the source of a syntax highlighting grammar

    • Old: [URL to grammar repo]
    • New: [URL to grammar repo]
  • [ ] I am updating a grammar submodule

  • [ ] I am adding new or changing current functionality

    • [ ] I have added or updated the tests for the new or changed functionality.
  • [ ] I am changing the color associated with a language

    • [ ] I have obtained agreement from the wider language community on this color change.
      • [URL to public discussion]
      • [Optional: URL to official branding guidelines for the language]

xiaq avatar Jun 13 '22 23:06 xiaq

@lildude Hi! Thanks for taking a look, I see you added the "Pending Popularity" which I assume means that the new language may not meet the popularity threshold.

Since the documented criterion is at least 200 unique repos, I wrote a program to test whether Elvish clears that criterion. The result is 224 repos as of today.

There are some false positives - not all .elv files are Elvish scripts. Clicking these repos randomly, roughly 1 or 2 out of every 10 repos are false positives. So the actual number of repos may be just a bit lower than 200.

Do you think this is close enough to the threshold, or should I try again the number of unique repos is clearly larger than 200?

xiaq avatar Jun 14 '22 16:06 xiaq

We're temporarily using the requirements detailed in https://github.com/github/linguist/issues/5756 because GitHub's search is struggling with extension searches which often results in inaccurate, zero or duplicate results.

lildude avatar Jun 14 '22 16:06 lildude

I see, thanks. The number of results for .elv currently stands at 1794, hopefully it will be over 2000 soon :)

Maybe it's valuable to link to that issue from CONTRIBUTING.md - I opened #5941 for this.

xiaq avatar Jun 14 '22 17:06 xiaq