HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
github-linguist
linguist
Ruby2011–2026
github-linguist / linguist

linguist

Language Savant. If your repository's language is being reported incorrectly, send us a pull request!

79Distinct people
94Mentions
0Explicit recommenders
13.8KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Language Savant. If your repository's language is being reported incorrectly, send us a pull request!

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year94 dated mentions

Observed mentions: 2011-12-19 08:04:13 UTC to 2026-08-16 01:46:32 UTC.

051015202011-01-01 00:00:00 UTC to 2012-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20112012-01-01 00:00:00 UTC to 2013-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments2013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 8 mentions; 0 submissions, 8 comments2014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 20 mentions; 2 submissions, 18 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 9 mentions; 0 submissions, 9 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 6 mentions; 1 submissions, 5 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments20182019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 6 mentions; 2 submissions, 4 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 6 mentions; 1 submissions, 5 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 7 mentions; 3 submissions, 4 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 7 mentions; 0 submissions, 7 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 7 mentions; 2 submissions, 5 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 5 mentions; 1 submissions, 4 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20112011-01-01 00:00:00 UTC2012-01-01 00:00:00 UTC101
20122012-01-01 00:00:00 UTC2013-01-01 00:00:00 UTC505
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC808
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC20218
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC909
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC202
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC615
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC303
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC624
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC615
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC734
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC707
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC101
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC725
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC514
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
Linguist This library is used on GitHub.com to detect blob languages, ignore binary or vendored files, suppress generated files in diffs, and generate language breakdown graphs. Documentation How Linguist works Change Linguist's behaviour with overrides Troubleshooting Contributing guidelines Installation Install the gem: gem install github-linguist Dependencies Linguist is a Ruby library so you will need a recent version of Ruby installed. There are known problems with the macOS/Xcode supplied version of Ruby that causes problems installing some of the dependencies. Accordingly, we highly recommend you install a version of Ruby using Homebrew, rbenv, rvm, ruby-build, asdf or other packaging system, before attempting to install Linguist and the dependencies. Linguist uses charlock_holmes for character encoding and rugged for libgit2 bindings for Ruby. These components have their own dependencies. charlock_holmes cmake pkg-config ICU zlib rugged libcurl OpenSSL You may need to install missing dependencies before you can install Linguist. For example, on macOS with Homebrew: brew install cmake pkg-config icu4c On Ubuntu: sudo apt-get install build-essential cmake pkg-config libicu-dev zlib1g-dev libcurl4-openssl-dev libssl-dev ruby-dev Usage Application usage Linguist can be used in your application as follows: require 'rugged' require 'linguist' repo = Rugged::Repository.new('.') project = Linguist::Repository.new(repo, repo.head.target_id) project.language #=> "Ruby" project.languages #=> { "Ruby" => 119387 } Command line usage The github-linguist executable operates in two distinct modes: Git Repository mode - Analyzes an entire Git repository (when given a directory path or no path) Single file mode - Analyzes a specific file (when given a file path) Git Repository A repository's languages stats can be assessed from the command line using the github-linguist executable. Without any options, github-linguist will output the language breakdown by percentage and file size. cd /path-to-repository github-linguist You can try running github-linguist on the root directory in this repository itself: $ github-linguist 66.84% 264519 Ruby 24.68% 97685 C 6.57% 25999 Go 1.29% 5098 Lex 0.32% 1257 Shell 0.31% 1212 Dockerfile Additional options --rev REV The --rev REV flag will change the git revision being analyzed to any gitrevisions(1) compatible revision you specify. This is useful to analyze the makeup of a repo as of a certain tag, or in a certain branch. For example, here is the popular Jekyll open source project. $ github-linguist jekyll 70.64% 709959 Ruby 23.04% 231555 Gherkin 3.80% 38178 JavaScript 1.19% 11943 HTML 0.79% 7900 Shell 0.23% 2279 Dockerfile 0.13% 1344 Earthly 0.10% 1019 CSS 0.06% 606 SCSS 0.02% 234 CoffeeScript 0.01% 90 Hack And here is Jekyll's published website, from the gh-pages branch inside their repository. $ github-linguist jekyll --rev origin/gh-pages 100.00% 2568354 HTML --breakdown The --breakdown or -b flag will additionally show the breakdown of files by language. You can try running github-linguist on the root directory in this repository itself: $ github-linguist --breakdown 66.84% 264519 Ruby 24.68% 97685 C 6.57% 25999 Go 1.29% 5098 Lex 0.32% 1257 Shell 0.31% 1212 Dockerfile Ruby: Gemfile Rakefile bin/git-linguist bin/github-linguist ext/linguist/extconf.rb github-linguist.gemspec lib/linguist.rb … --strategies The --strategies or -s flag will show the language detection strategy used for each file. This is useful for understanding how Linguist determined the language of specific files. Note that unless the --json flag is specified, this flag will set the --breakdown flag implicitly. You can try running github-linguist on the root directory in this repository itself with the strategies flag: $ github-linguist --breakdown --strategies 66.84% 264519 Ruby 24.68% 97685 C 6.57% 25999 Go 1.29% 5098 Lex 0.32% 1257 Shell 0.31% 1212 Dockerfile Ruby: Gemfile [Filename] Rakefile [Filename] bin/git-linguist [Extension] bin/github-linguist [Extension] lib/linguist.rb [Extension] … If a file's language is affected by .gitattributes, the strategy will show the original detection method along with a note indicating whether the gitattributes setting changed the result or confirmed it. For instance, if you had the following .gitattributes overrides in your repo: *.ts linguist-language=JavaScript *.js linguist-language=JavaScript the output of Linguist would be something like this: 100.00% 217 JavaScript JavaScript: demo.ts [Heuristics (overridden by .gitattributes)] demo.js [Extension (confirmed by .gitattributes)] --json The --json or -j flag output the data into JSON format. $ github-linguist --json {"Dockerfile":{"size":1212,"percentage":"0.31"},"Ruby":{"size":264519,"percentage":"66.84"},"C":{"size":97685,"percentage":"24.68"},"Lex":{"size":5098,"percentage":"1.29"},"Shell":{"size":1257,"percentage":"0.32"},"Go":{"size":25999,"percentage":"6.57"}} This option can be used in conjunction with --breakdown to get a full list of files along with the size and percentage data. $ github-linguist --breakdown --json {"Dockerfile":{"size":1212,"percentage":"0.31","files":["Dockerfile","tools/grammars/Dockerfile"]},"Ruby":{"size":264519,"percentage":"66.84","files":["Gemfile","Rakefile","bin/git-linguist","bin/github-linguist","ext/linguist/extconf.rb","github-linguist.gemspec","lib/linguist.rb",...]}} NB. The --strategies flag has no effect, when the --json flag is present. Single file Alternatively you can find stats for a single file using the github-linguist executable. You can try running github-linguist on files in this repository itself: $ github-linguist grammars.yml grammars.yml: 884 lines (884 sloc) type: Text
Read the full README on GitHub

What Hacker News says

94 sources
> Why a new language? In my opinion, Starlark (in rust, Apache 2: <https://github.com/facebook/starlark-rust/blob/v0.13.0/LICEN...>) is the way since it is designed for sandboxed environments and also (AIUI) was initially designed to support Bazel, a build tool Now, I'm totally on board that people can hate on whitespace sensitive languages, but if my choice was "make my own language that no one has ever heard of" or "delete the Python hater's emails" ... It also would mean that you could tag your Werkfile in .gitattributes with linguist annotations[1] and they'd syntax highlight, which isn't the case with your own language https://github.com/simonask/werk/blob/5990c8a9536a1a76c3da59... 1: https://github.com/github-linguist/linguist/blob/v9.0.0/docs...
In Show HN: Werk, a simple build tool and command runner
https://github.com/pragtical/plugins/commit/54096a6461f5c034... makes me long for The One Grammar To Rule Them &trade; I thought for a while that TextMate bundles[1] were that, especially since JetBrains[2], Linguist[3] and VSCode[4] honor them. However, in the spirit of "the good thing about standards ..." highlight.js does[5] almost the same thing that Pragtical does which makes me feel even worse I had high hopes for Tree-Sitter since it seems to have really won mindshare, but the idea of having an executable grammar spec[6] is ... well, no wonder it hasn't caught on outside of that specific ecosystem 1: https://github.com/rspec/rspec.tmbundle/blob/1.1.12/Syntaxes... 2: https://github.com/JetBrains/intellij-community/blob/idea/24... 3: https://github.com/github-linguist/linguist/blob/v7.30.0/lib... 4: https://github.com/microsoft/vscod
Read the rest
In Pragtical: Practical and pragmatic code editor
Github uses Linguist for syntax highlighting and has a section in their CONTRIBUTING document for fixing bad syntax highlighting [0]. Admittedly I couldn't figure out exactly what repo is being used for Java's syntax highlighting since vendor/README.md says Java is using tree-sitter/tree-sitter-java and grammar.js in that repo appeears to already include references to record. languages.yml [1] shows ace_mode java, and ace editor's java_highlight_rules.js doesn't mention record anywhere. I'm not clear if github is using ace editor or code mirror, since both are mentioned there. Hopefully this helps get started on improving the poor syntax highlighting experience. [0] https://github.com/github/linguist/blob/master/CONTRIBUTING.... [1] https://github.com/github/linguist/blob/c34f887f48d81e2ed42b... [2] https://github.com/ajaxorg/ace/blob/a2e
Read the rest
In Java 20 / JDK 20: General Availability
Does this really work for jump to file? (we're not talking language statistics or supressing diffs on PRs, which is mostly what linguist readme is talking about). Quoting the docs on finding files: https://docs.github.com/en/search-github/searching-on-github... > File finder results exclude some directories like build, log, tmp, and vendor. To search for files within these directories, use the filename code search qualifier. (The inability of quick jumping to files from /build/ folder with `T` has been driving me crazy for YEARS!) Correct me if I'm wrong, but checking those two files: - https://github.com/github/linguist/blob/master/lib/linguist/... - https://github.com/github/linguist/blob/master/lib/linguist/... I don't see `/build` matching anything there. So to me this `/build` suppression from search results seems like controlled by
Read the rest
some other piece of software at GitHub :/ Also, files from `/build` are not hidden in diffs, so per this table: https://github.com/github/linguist/blob/HEAD/docs/overrides.... they are not "linguist-generated".
In Bun: Fast JavaScript runtime, transpiler, and NPM client written in Zig

Showing the 15 most recent of 94 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.