Skip to main content

batuta/falsification/hypothesis_driven/
helpers.rs

1//! Helper functions for hypothesis-driven checks.
2
3use std::path::Path;
4
5/// Check if project files contain any of the given patterns.
6pub(super) fn check_for_pattern(project_path: &Path, patterns: &[&str]) -> bool {
7    crate::falsification::helpers::files_contain_pattern(
8        project_path,
9        &["src/**/*.rs", "**/*.yaml", "**/*.toml", "**/*.json", "**/*.md"],
10        patterns,
11    )
12}
13
14/// Check if CI configuration contains any of the given patterns.
15pub(super) fn check_ci_for_pattern(project_path: &Path, patterns: &[&str]) -> bool {
16    crate::falsification::helpers::ci_contains_pattern(project_path, patterns)
17}