tmc_langs_notests/
policy.rs

1//! The student file policy for no-tests projects.
2
3use std::path::Path;
4use tmc_langs_framework::{StudentFilePolicy, TmcProjectYml};
5
6/// The no-tests policy considers all files to be student source files by default.
7pub struct NoTestsStudentFilePolicy {
8    project_config: TmcProjectYml,
9}
10
11impl StudentFilePolicy for NoTestsStudentFilePolicy {
12    fn new_with_project_config(project_config: TmcProjectYml) -> Self
13    where
14        Self: Sized,
15    {
16        Self { project_config }
17    }
18
19    fn get_project_config(&self) -> &TmcProjectYml {
20        &self.project_config
21    }
22
23    fn is_non_extra_student_file(&self, _file_path: &Path) -> bool {
24        true
25    }
26}