Skip to content

locof (lines of code of) is a prototype to count the lines of code within a specified directory, written in Rust.

License

Notifications You must be signed in to change notification settings

lucasbombarda/locof

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LOCOF - Lines Of Code Of

This is a CLI tool to count the lines of code (LOC) in a given directory written in Rust. Inspired in the cloc tool. This is not meant to be a replacement for cloc.

Note that this is an early-stage prototype, so functionality may be limited, and breaking changes may occur as development progresses.

Installation and Usage

Ensure that you have Rust installed on your machine. If you don't have it, you can install it by following the instructions on the official website.

Clone this repository by running:

$ git clone --depth=1 https://github.com/lucasbombarda/locof

In Windows or Linux, if you want to run the tool without installing it, you can run:

$ cargo run --release -- <path>

Alternatively, you can install the tool by running the following command:

$ cargo install --path .

Then, you can run:

$ locof <path>

Performance

Now, it's single-threaded and it's not optimized, and still is WAY faster than cloc. Note that locof isn't considering the same things as cloc, like .gitignore files, for example. Here are some benchmarks on Linux kernel source code:

  • locof:

performance

  • cloc:

performance

Roadmap

  • Count the lines of code, comments and blank lines in a given directory
  • Add --exclude-dir and --exclude-ext flags
  • Add support to .gitignore files
  • Output in JSON format
  • Multi-threading

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

locof (lines of code of) is a prototype to count the lines of code within a specified directory, written in Rust.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages