libscilo/config/instantiated_config/
defaults.rs1use std::sync::LazyLock;
4
5use regex::Regex;
6use strum::IntoEnumIterator;
7
8use crate::{InstantiatedConfig, LintCheck, RootDirs};
9
10pub(crate) static CODE_RESULTS_SUBDIR_REGEX: LazyLock<Regex> = LazyLock::new(|| {
14 Regex::new(r"2\d{3}-(0[1-9]|1[0-2])-([0-2][0-9]|3[0-1])_[A-Za-z0-9-]+").unwrap()
15});
16
17static README_FILE_NAMES: LazyLock<Vec<String>> = LazyLock::new(|| {
21 vec![
22 String::from("README.md"),
23 String::from("README.org"),
24 String::from("README.txt"),
25 String::from("README"),
26 ]
27});
28
29static WORKFLOW_FILE_NAMES: LazyLock<Vec<String>> = LazyLock::new(|| {
32 vec![
33 String::from("Snakefile"),
35 String::from("_targets.R"),
37 String::from("main.cwl"),
39 String::from("main.nf"),
41 String::from("main.pipe"),
43 String::from("main.w"),
45 String::from("main.wdl"),
47 String::from("Makefile"),
49 ]
50});
51
52impl Default for InstantiatedConfig {
53 fn default() -> Self {
54 Self {
55 root_dirs: RootDirs::default(),
56 code_results_subdir_regex: Some((*CODE_RESULTS_SUBDIR_REGEX).clone()),
57 lints: LintCheck::iter().collect(),
59 root_files: Vec::new(),
60 readme_names: Some((*README_FILE_NAMES).clone()),
61 workflow_names: Some((*WORKFLOW_FILE_NAMES).clone()),
62 ignored: Vec::new(),
63 }
64 }
65}