1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! Validation subcommand for Gmail retention rules.
//!
//! Loads a rules file and checks each rule for correctness without
//! executing any actions or making API calls. Exits with a non-zero
//! status if any issues are found.
use Parser;
use Path;
use Rules;
use crateResult;
/// Validate a rules file without executing any actions.
///
/// Checks each rule for:
/// - Non-empty label set
/// - Valid retention period (e.g. `d:30`, `m:6`, `y:2`)
/// - Valid action (`Trash` or `Delete`)
///
/// Also checks across rules for duplicate labels.
///
/// Exits 0 if all rules are valid, non-zero otherwise.