-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
言語一覧の追加 #102
Comments
拡張子と言語のペアのデータベースが存在すれば、このリポジトリから"RADWIMPS.(.*)"のファイルを取得してCIとかから言語一覧を生成できそう? |
審査待ちの言語も載せてほしいです |
審査待ちについては追記予定です |
できそうではあるけども……。 |
GitHub がリポジトリ毎に言語統計を生成するために使用している、linguist という Ruby 製のツールが言語一覧の生成に使えそうです。 https://github.com/github/linguist 実際に僕の環境で動かしてみると、現状の master ブランチではこんな結果になりました。( $ github-linguist --json > result.json
{"AppleScript":["RADWIMPS.applescript"],"Shell":["RADWIMPS.bash","RADWIMPS.dash"],"C":["RADWIMPS.c"],"Clojure":["RADWIMPS.clj"],"C++":["RADWIMPS.cpp","RADWIMPS.h"],"Crystal":["RADWIMPS.cr"],"C#":["RADWIMPS.cs"],"D":["RADWIMPS.d"],"Dart":["RADWIMPS.dart"],"Emacs Lisp":["RADWIMPS.el"],"Elixir":["RADWIMPS.exs"],"F#":["RADWIMPS.fs"],"Forth":["RADWIMPS.fth"],"Go":["RADWIMPS.go"],"Groovy":["RADWIMPS.groovy"],"Hack":["RADWIMPS.hack"],"Haskell":["RADWIMPS.hs"],"HTML":["RADWIMPS.html"],"Haxe":["RADWIMPS.hx"],"Java":["RADWIMPS.java"],"Julia":["RADWIMPS.jl"],"JavaScript":["RADWIMPS.js"],"Kotlin":["RADWIMPS.kt"],"Common Lisp":["RADWIMPS.lsp"],"Lua":["RADWIMPS.lua"],"Objective-C":["RADWIMPS.m"],"OCaml":["RADWIMPS.ml"],"Nim":["RADWIMPS.nim"],"PHP":["RADWIMPS.php"],"Perl":["RADWIMPS.pl"],"PowerShell":["RADWIMPS.ps1"],"Python":["RADWIMPS.py"],"Ruby":["RADWIMPS.rb"],"Reason":["RADWIMPS.re"],"Racket":["RADWIMPS.rkt"],"Rust":["RADWIMPS.rs"],"Scala":["RADWIMPS.scala"],"Scheme":["RADWIMPS.scm"],"Swift":["RADWIMPS.swift"],"TeX":["RADWIMPS.tex"],"TypeScript":["RADWIMPS.ts"],"V":["RADWIMPS.v"],"Vim script":["RADWIMPS.vim"]} こんな風に、キーが言語名の文字列で、対応する値がソースファイル名の配列になっているオブジェクトが返ります。 デフォルトの言語判定方法に誤りがある場合は、 |
もうひとつ考えられる方法としては、そもそもソースファイルを言語ごとに異なるサブディレクトリにわけて配置して、それぞれのディレクトリ名が言語名と対応するようにする(今後言語を追加する際にもそのルールに従わせる)、という方法があると思います。 これなら linguist が対応できてないような言語でもスクリプトで柔軟に対処でき、なおかつ (Node.jsでの ディレクトリツリーがそのまま言語一覧のような見た目になるので、この方法を採用するなら言語一覧自体生成する必要もないかもしれません。 |
#123 にてディレクトリ構成を検討します |
$ github-linguist --json | jq . indented json{
"Ada": [
"RADWIMPS.adb"
],
"AppleScript": [
"RADWIMPS.applescript"
],
"Shell": [
"RADWIMPS.bash",
"RADWIMPS.dash"
],
"C": [
"RADWIMPS.c"
],
"Clojure": [
"RADWIMPS.clj"
],
"CoffeeScript": [
"RADWIMPS.coffee"
],
"C++": [
"RADWIMPS.cpp",
"RADWIMPS.h",
"RADWIMPS.ino"
],
"Crystal": [
"RADWIMPS.cr"
],
"C#": [
"RADWIMPS.cs"
],
"D": [
"RADWIMPS.d"
],
"Dart": [
"RADWIMPS.dart"
],
"Pascal": [
"RADWIMPS.dpr"
],
"Emacs Lisp": [
"RADWIMPS.el"
],
"Erlang": [
"RADWIMPS.erl"
],
"Elixir": [
"RADWIMPS.exs"
],
"F#": [
"RADWIMPS.fs"
],
"Forth": [
"RADWIMPS.fth"
],
"Go": [
"RADWIMPS.go"
],
"Groovy": [
"RADWIMPS.groovy"
],
"Hack": [
"RADWIMPS.hack"
],
"Haskell": [
"RADWIMPS.hs"
],
"HTML": [
"RADWIMPS.html"
],
"Haxe": [
"RADWIMPS.hx"
],
"Io": [
"RADWIMPS.io"
],
"Java": [
"RADWIMPS.java"
],
"Julia": [
"RADWIMPS.jl"
],
"JavaScript": [
"RADWIMPS.js"
],
"Kotlin": [
"RADWIMPS.kt"
],
"Common Lisp": [
"RADWIMPS.lsp"
],
"Lua": [
"RADWIMPS.lua"
],
"Objective-C": [
"RADWIMPS.m"
],
"OCaml": [
"RADWIMPS.ml"
],
"Nim": [
"RADWIMPS.nim"
],
"OpenEdge ABL": [
"RADWIMPS.p"
],
"Processing": [
"RADWIMPS.pde"
],
"PHP": [
"RADWIMPS.php"
],
"Perl": [
"RADWIMPS.pl"
],
"PowerShell": [
"RADWIMPS.ps1"
],
"Python": [
"RADWIMPS.py"
],
"Ruby": [
"RADWIMPS.rb"
],
"Reason": [
"RADWIMPS.re"
],
"Racket": [
"RADWIMPS.rkt"
],
"Rust": [
"RADWIMPS.rs"
],
"Scala": [
"RADWIMPS.scala"
],
"Scheme": [
"RADWIMPS.scm"
],
"Swift": [
"RADWIMPS.swift"
],
"TeX": [
"RADWIMPS.tex"
],
"TypeScript": [
"RADWIMPS.ts"
],
"V": [
"RADWIMPS.v"
],
"Visual Basic .NET": [
"RADWIMPS.vb"
],
"Vim script": [
"RADWIMPS.vim"
],
"Vue": [
"RADWIMPS.vue"
]
}
|
No description provided.
The text was updated successfully, but these errors were encountered: