1#![cfg_attr(
2 test,
3 allow(
4 clippy::unwrap_used,
5 clippy::expect_used,
6 reason = "tests use unwrap and expect to keep fixture setup concise"
7 )
8)]
9
10mod config;
11mod config_writer;
12mod external_plugin;
13mod fixability;
14mod jsonc;
15pub mod levenshtein;
16mod rule_pack;
17mod workspace;
18
19pub use config::*;
20pub use config_writer::*;
21pub use external_plugin::*;
22pub use fixability::*;
23pub use rule_pack::*;
24pub use workspace::*;
25
26use std::path::{Path, PathBuf};
27
28const WALKTHROUGH_STATE_FILE: &str = "walkthrough-state.json";
30
31#[must_use]
38pub fn walkthrough_state_path(cache_dir: &Path) -> PathBuf {
39 cache_dir.join(WALKTHROUGH_STATE_FILE)
40}
41
42#[cfg(test)]
43mod walkthrough_state_path_tests {
44 use super::walkthrough_state_path;
45 use std::path::Path;
46
47 #[test]
48 fn joins_state_file_under_cache_dir() {
49 let path = walkthrough_state_path(Path::new("/project/.fallow"));
50 assert_eq!(path, Path::new("/project/.fallow/walkthrough-state.json"));
51 }
52}