Skip to main content

looks_like_source_code

Function looks_like_source_code 

Source
pub fn looks_like_source_code(content: &str) -> bool
Expand description

Heuristic fallback: does this text look like source code (vs command output)?

Deliberately conservative — it only returns true when code signals clearly dominate and shell/log signals are essentially absent, so genuine logs and build output are still compressed. Used only when the tool name is unknown.