Releases: Moderrek/lines
Releases · Moderrek/lines
v1.2.0 - Refactored Architecture with Library Support
v1.2.0 - Refactored Architecture with Library Support
Overview
This release marks a significant milestone with a complete project restructuring that transforms lines into both a powerful CLI tool and a reusable Go library. Major improvements include configurable buffer management, JSON output support, and automated multi-platform builds.
Major Changes
Refactored Project Structure
- Separated CLI logic from core functionality into
cmd/linesandpkg/linesdirectories - The core line counting engine is now available as a public library at
github.com/moderrek/lines/pkg/lines - Improved code organization for better maintainability and reusability
New Features
- JSON output support: Use
--jsonflag to output results in machine-readable format - Configurable buffer sizes: Users can now customize scanner buffer initial and maximum sizes through the Config struct
- Library API: Go developers can now import and use lines as a dependency in their projects
CI/CD & Release Automation
- Enhanced GitHub Actions workflow with code quality checks
- Added
go fmt,go vet, andgo mod tidyverification - Automated cross-platform binary builds for Linux, macOS, and Windows
- Automatic release creation with compiled binaries
Documentation
- Completely rewritten README with clear installation and usage instructions
- Added library usage examples for Go developers
- GitHub sponsorship configuration
Installation
go install github.com/Moderrek/lines/cmd/lines@v1.2.0Usage Examples
Analyze current directory:
linesDisplay top 5 file extensions by line count:
lines --dir ~/projects/my-app --top 5Get results in JSON format for scripting:
lines --dir ~/projects/my-app --jsonUse as a library in your Go project:
import "github.com/moderrek/lines/pkg/lines"
config := lines.Config{
IncludeHidden: false,
BufferInitialSize: 64 * 1024,
BufferMaxSize: 1024 * 1024,
}
counter := lines.NewCounter(config)
result, err := counter.Run("./src")1.0.1
1.0.0
Blazingly fast command-line concurrent non-blank line counter implemented in GO using lightweight execution threads.
⚙️ Usage
lines # Prints file with the most lines at current directory
lines --dir # Path to the analysis folder
lines --top N # Prints the top N files
lines --hidden # Allow to analyze hidden files & dirs
lines --version # Prints installed version
lines --help # Prints help📈 Example output
lines --dir C:\Users\Moderr\dev --top 5Analyzing.. C:\Users\Moderr\dev
.java | Lines of code: 24409
.json | Lines of code: 8828
.yaml | Lines of code: 4980
.tsx | Lines of code: 4357
.yml | Lines of code: 1122
Time taken: 27.157ms to analyze 79 635 files
