Skip to content

Commit

Permalink
include ipynb files as student files in python projects
Browse files Browse the repository at this point in the history
  • Loading branch information
Heliozoa committed Nov 17, 2021
1 parent d14b588 commit a5e4a73
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugins/python3/src/policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ impl StudentFilePolicy for Python3StudentFilePolicy {
None => true,
};
let is_py_file = path.extension() == Some(OsStr::new("py"));
let is_ipynb = path.extension() == Some(OsStr::new("ipynb"));

// all files in non-tmc and non-test subdirectories are considered student files
let is_in_exercise_subdir = path.starts_with("test") || path.starts_with("tmc");

in_src && !is_cache_file
|| is_in_project_root && is_py_file
|| !is_in_exercise_subdir && !is_in_project_root && !is_cache_file
|| is_ipynb && !is_cache_file
}
}

Expand Down

0 comments on commit a5e4a73

Please sign in to comment.