Lingo
A fast CLI tool for counting lines of code in a workspace.
Built with speed in mind, lingo can count lines of very large code repositories in under a second. examples
Lingo supports almost every programming language, if it's missing one feel free to make an issue
Usage
CLI
By default, lingo will count the lines of code in the current directory .
.
However, a directory can be passed in.
Additionally lingo does not count .gitignored
files, but this can be disabled by passing the -n
flag.
USAGE:
lingo [FLAGS] <directory>
FLAGS:
-h, --help Print help information
-n, --nogitignore Ignores any .gitignore files
API
import "github.com/nathanielfernandes/lingo/lingo"
func main() {
// walks through the directory and returns a map of language names
// to language objects
/* type Language struct {
Name string
Files []string
Count uint32
Color string
}
*/
langs := lingo.GetLanguages(".", true)
// Counts the lines of all the languages found, updating
// the language objects
langs.CountLines()
// The lines are counted on goroutines. This wait, waits
// for all the goroutines to complete
langs.Wait()
// if you just need the line count right away you can use
langs.CountLinesNow()
// This counts the lines and waits for the goroutines to
// complete
}
Screenshots
all screenshots taken were of iterm
I used bubbletea to create the clean ui.
In this screenshot lingo was called in a folder with around 50+ projects
amounting to 162,761 files
and 3,847,173
lines of code. All counted and displayed in approx. 5 seconds
Author
Nathaniel Fernandes [email protected]
This project was inspired by tokei
Missing file extensions
As per official glsl spec of compiler:
.mesh for a mesh shader .task for a task shader .rgen for a ray generation shader .rint for a ray intersection shader .rahit for a ray any hit shader .rchit for a ray closest hit shader .rmiss for a ray miss shader .rcall for a general ray callable shader
Is all missing
Hlsl misses (for some of the big ones)
.hs for hull shader
.ds for domain shader
.vs for vertex shader
.ps for pixel shader
.cs for compute shader
.gs for geometry shader
A few others from the shader side of naming behind official spec is missing