Skip to main content

file_path_penalty

Function file_path_penalty 

Source
pub fn file_path_penalty(file_path: &str) -> f32
Expand description

Combined multiplicative penalty for all applicable path patterns.

Always in (0.0, 1.0]. Returns 1.0 when no patterns match. Each matched category multiplies into the result independently, so a file matching both a test-dir pattern and a re-export filename pays STRONG_PENALTY * MODERATE_PENALTY.

Backslashes in file_path are normalised to forward slashes before matching, so Windows-style paths work too.