linecop
Language-aware file size linter. Patrols your code base to enforce per-language line count limits using tokei for accurate counting.
Installation
Cargo
Nix flake
Binary releases
Pre-built binaries for Linux and macOS are available on the releases page.
Quick start
Usage
Commands:
| Command | Description |
|---|---|
init |
Generate a starter .linecop.yaml |
schema |
Print JSON Schema for config validation |
Options:
| Option | Description |
|---|---|
-c, --config <FILE> |
Config file path (default: <PATH>/.linecop.yaml) |
-q, --quiet |
Suppress output (exit code only) |
--format <text|json> |
Output format (default: text) |
--color <auto|always|never> |
Control color output |
Examples
# Scan a specific directory
# Use a custom config
# JSON output for CI
# Generate JSON Schema for editor validation
Configuration
Create a .linecop.yaml in your project root:
limits:
Rust: 500
Markdown: 200
Python: 400
count_mode: total # total | code | code-comments
overrides:
- pattern: "src/generated_*.rs"
limit: 1000
- pattern: "RESEARCH.md"
exclude: true
exclude_dirs:
- target
- node_modules
Language names follow tokei conventions.
Contributing
See CONTRIBUTING.md for coding conventions and guidelines.