github-linguist/linguist hiện có 13.8k sao trên GitHub, viết chủ yếu bằng Ruby. Language Savant. If your repository's language is being reported incorrectly, send us a pull request!
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
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:
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.
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:
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:
If a file's language is affected by .gitattributes, the strategy will show whether the gitattributes setting changed the result or confirmed it:
In this fictitious example, it says "confirmed by .gitattributes" since the detection process (using the Filename strategy) would have given the same output as the override:
.devcontainer/devcontainer.json: 27 lines (27 sloc)
type: Text
mime type: application/json
language: JSON with Comments
strategy: Filename (confirmed by .gitattributes)
In this other fictitious example, it says "overridden by .gitattributes" since the gitattributes setting changes the detected language to something different:
test.rb: 13 lines (11 sloc)
type: Text
mime type: application/x-ruby
language: Java
strategy: Extension (overridden by .gitattributes)
Here, the .rb file would normally be detected as Ruby by the Extension strategy, but .gitattributes overrides it to be detected as Java instead.
--json
Using the --json flag will give you the output for a single file in JSON format:
The language grammars included in this gem are covered by their repositories' respective licenses.
vendor/README.md lists the repository for each grammar.
All other files are covered by the MIT license, see LICENSE.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/github-linguist/linguist là nguồn chính thức.
github-linguist/linguist có bao nhiêu sao?
github-linguist/linguist có 13.8k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/github-linguist/linguist. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
github-linguist/linguist có những chủ đề gì?
GitHub topics của github-linguist/linguist: "language-grammars", "language-statistics", "linguistic", "syntax-highlighting". TopGit xếp repo vào nhóm mã nguồn mở.
github-linguist/linguist còn đang phát triển không?
Commit gần nhất trên github-linguist/linguist là 12 ngày trước (theo timestamp GitHub). Repo có 5.5k fork — một chỉ báo về mức độ quan tâm của cộng đồng.
github-linguist/linguist viết bằng ngôn ngữ gì?
github-linguist/linguist chủ yếu viết bằng Ruby. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về linguist?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về linguist.