https://github.com/thehamdiz/countroo
CountRoo is a rust crate that counts your project's (or workspace) lines of code, for any programming language with features to enable or disable counting empty lines and certain programming languages.
https://github.com/thehamdiz/countroo
Last synced: 20 days ago
JSON representation
CountRoo is a rust crate that counts your project's (or workspace) lines of code, for any programming language with features to enable or disable counting empty lines and certain programming languages.
- Host: GitHub
- URL: https://github.com/thehamdiz/countroo
- Owner: theHamdiz
- License: mit
- Created: 2024-02-25T19:09:32.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-29T08:53:32.000Z (about 1 year ago)
- Last Synced: 2025-04-01T23:32:07.702Z (26 days ago)
- Language: Rust
- Size: 108 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CountRoo π¦π
Welcome to the wild world of `CountRoo`, your go-to Rust crate for navigating the vast wilderness of your codebase!
π²π Whether you're tracking down every line of Rust code, or just curious about your project's stats.
Or simply want to know the contribution ratio of each language `CountRoo` hops right to it, giving you the insights you need with a side of fun. π

> This **README** is generated by **ChatGPT** & not the crate's author, just because I'm lazy.
## Quick Start π
Adding `CountRoo` to your Rust project is easier than spotting a koala in a eucalyptus tree! Hereβs how you can get started:
1. **Add CountRoo to your Cargo.toml** π
```toml
[build-dependencies]
countroo = { version = "0.1.7", features = ["default"]}
```2. **Create or Update Your build.rs** π οΈ
Ensure your project has a `build.rs` file in the root (right next to `Cargo.toml`). If it's missing, now's the time to add it!
3. **Invoke CountRoo with Magic Macros** β¨
Inside your `build.rs`, let `CountRoo` work its magic by using its provided macros to analyze your project:
```rust
use countroo::prelude::*;
fn main() {
count_it_all!();
// Or for the adventurous:
// countroo::count_some!();
// If you're using it for a workspace, you can just use it like this inside any project's build.rs
count_it_all!(workspace: true);
}
```## Features at a Glance π
`CountRoo` isn't your average crate; itβs packed with features that make code analysis both insightful and delightful:
- **Lines of Code Counter** π: Discover how many lines of code your project spans, with options to include or exclude empty lines.
- **Config Flexibility** π: Supports a variety of config formats including TOML, JSON, YAML, XML, and even simple newline-separated configs, although for the initial release they will not be available.
- **Parallel Processing** β‘: Utilizes `rayon` for speedy analysis, because who likes waiting?
- **Customizable and Extensible** π οΈ: Tailor `CountRoo` to your needs by specifying which file extensions to include in the count.
## Example Macro Usage π
Want to quickly count all lines of code? Just use the `count_it_all!` macro in your `build.rs`. For a more selective count, the `count_some!` macro is your friend. Hereβs a peek at how itβs done:
```rust
use countroo::prelude::*;
fn main() {
// To count everything:
count_it_all!();
// Feeling selective?
count_some!();
}
```## Dive Deeper π€Ώ
`CountRoo` comes with comprehensive documentation for those looking to explore its full potential. From handling custom errors to deep-diving into configurations, itβs all there at your fingertips.
## Wrapping Up π
So, what's the hold-up? Let `CountRoo` take you on a code counting adventure. Discover the hidden treasures within your codebase and maybe, just maybe, find out itβs bigger (or smaller) than you thought. Happy coding, Rustaceans! π¦π