codstts

Crates.iocodstts
lib.rscodstts
version0.1.0
created_at2025-01-26 06:30:11.573622+00
updated_at2025-01-26 06:30:11.573622+00
descriptionA code statistics tool that analyzes programming language distribution in projects
homepage
repositoryhttps://github.com/zheng0116/codstts
max_upload_size
id1531107
size54,895
stackzheng (zheng0116)

documentation

README

Codstts

Codstts License Rust Version

English | δΈ­ζ–‡

🌟 Overview

A code statistics tool written in Rust that analyzes programming language distribution in projects.

πŸš€ Features

  • Multiple programming language recognition
  • Simple and detailed display modes
  • Customizable configuration
  • Accurate code, comment, and blank line counting
  • Beautiful command-line interface
  • Support for .gitattributes language overrides
  • Ignores common binary files, documentation, and configuration files

Installation

cargo install codstts

Usage

Basic usage:

# Analyze current directory
codstts

# Use simple mode
codstts -s

# Use detailed mode
codstts -d

# Analyze specific directory
codstts path/to/your/project

Configuration

You can create a .codstts.toml file in your project root for custom configuration:

# Paths to ignore
ignore_paths = ["vendor", "node_modules"]

# Language mappings
[language_mappings]
"jsx" = "React"
"tsx" = "React"

# Extensions to exclude
exclude_extensions = ["log", "tmp"]

# Files to exclude
exclude_files = ["LICENSE", "README.md"]

Output Examples

Simple mode:

Languages
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ

● Python 62.1% (15666 bytes)
● JavaScript 16.1% (4046 bytes)
● CSS 13.9% (3504 bytes)
● HTML 7.3% (1836 bytes)
● Shell 0.6% (149 bytes)

Detailed mode includes additional information such as code lines, comment lines, etc.

License

This project is open-sourced under the MIT

Contributing

Issues and Pull Requests are welcome!

Commit count: 6

cargo fmt