Skip to main content

Crate linecheck

Crate linecheck 

Source
Expand description

linecheck — enforce per-file line limits across your codebase.

This crate is both a CLI tool (linecheck) and a Rust library. The library API lets you embed line-count checking into your own tools or test harnesses.

§Quick start

use linecheck::{check_file, CheckOptions};
use std::path::Path;

let result = check_file(Path::new("src/main.rs"), None, &CheckOptions::default()).unwrap();
println!("{} lines — {:?}", result.lines, result.status);

Re-exports§

pub use checker::CheckOptions;
pub use checker::check_content;
pub use checker::check_file;
pub use config::Config;
pub use config::ConfigResolver;
pub use config::load_config;
pub use files::collect_files;
pub use preset::Preset;
pub use result::FileResult;
pub use result::Status;
pub use rule::Rule;

Modules§

checker
Core file-checking logic: resolves limits and returns a FileResult.
config
YAML configuration loading and hierarchical config resolution.
files
File collection: walks paths and applies exclude patterns.
lines
Low-level line counting and inline-ignore detection.
preset
Built-in strictness presets.
result
FileResult and Status — the output types of a single file check.
rule
The Rule type — a single pattern/limit pair from a config file.