gomeasure is a CLI tool that measures the lines of code and the count of files in a directory or project
This project is open source. You can simply clone this repo and build using:
go build -o bin/gomeasure main.go
Checkout the most updated releases here and download the binary that corresponds to your operating system
- Using homebrew
$ brew tap lordvidex/lordvidex
$ brew install gomeasure
$ gomeasure --version # to confirm
- To install on debian distributions copy and paste the following command in your terminal
curl "https://raw.githubusercontent.com/lordvidex/gomeasure/master/scripts/install.sh" | sh
You can use the docker image to run gomeasure.
docker run --rm -v $(pwd):/app ghcr.io/lordvidex/gomeasure:alpine line /app
- The
-v
argument is used to mount the directory to be measured to the container's/app
directory. Therefore, to measure any directory instead of the current directory, you can replace$(pwd)
with the path to the directory you want to measure. - The
--rm
argument is used to remove the container after the command is executed to prevent dangling containers. - All arguments after the image name are passed to the gomeasure command.
- The
/app
should not be replaced because source directory is mapped to/app
in the container.
- To uninstall on debian distributions copy and paste the following command in your terminal
curl "https://raw.githubusercontent.com/lordvidex/gomeasure/master/scripts/uninstall.sh" | sh
gomeasure --help
gomeasure uses a configuration file to make it easier to fine tune the CLI flags.
gomeasure looks for a file named .gomeasure.yaml
in the current directory. If it doesn't find it, it looks for it in the home directory. If no configuration file is found, it uses the default values.
Note that the priority of the configurations are as follows:
- CLI flags (highest priority)
- Configuration file (in current directory)
- Configuration file (in home directory)
- Default values (lowest priority)
Checkout the example configuration file to get started.
Normally, the program reads all kinds of file and returns the number of lines in each of them. Therefore, it is up to the developer to filter out the files to be scanned with
flags -i
and -I
.