is_documentation

Function is_documentation 

Source
pub fn is_documentation(file: impl AsRef<Path>, matcher: &RegexSet) -> bool
Expand description

Checks if a file is documentation by checking if it matches any of the documentation rules.

§Example

use std::path::PathBuf;
use regex::RegexSet;
use linguist::utils::is_documentation;

let rules = RegexSet::new(linguist::utils::DOCS).unwrap();
let path = PathBuf::from("/foo/docs");
assert!(is_documentation(path, &rules));