Language Detection Functions now Available
AskGit now supports SQL functions for detecting languages and file types leveraging the open-source enry project
The enry project describes itself as a
Programming language detector and toolbox to ignore binary or vendored files. enry, started as a port to Go of the original Linguist Ruby library, that has an improved 2x performance.
The AskGit v0.4.1 release integrates enry capability as SQL scalar functions, so for example:
SELECT path, enry_detect_language(path, contents) AS lang FROM fileswill list every file in a repo’s HEAD and report back the detected language (according to enry). You can find a full list of the implemented enry functionality in our README, copied in summary below:
enry_detect_languageenry_is_binaryenry_is_configurationenry_is_documentationenry_is_dot_fileenry_is_generatedenry_is_imageenry_is_testenry_is_vendor
As usual, check out the demo site to try queries in your browser 🎉

