@@ -15,7 +15,9 @@ pub struct WorkspaceRule {
15
15
/// The trigger of the rule is what causes it to be evaluated in the app.
16
16
trigger : Trigger ,
17
17
/// These filtes determine what files or changes the rule applies to.
18
- /// Within a rule, multiple filters are combined with OR logic (i.e. it's sufficient to match any of the filters)
18
+ /// Within a rule, multiple filters are combined with AND logic (i.e. all conditions must be met).
19
+ /// This allows for the expressions of rules like "If a file is modified, its path matches
20
+ /// the regex 'src/.*', and its content matches the regex 'TODO', then do something."
19
21
filters : Vec < Filter > ,
20
22
/// The action determines what happens to the files or changes that matched the filters.
21
23
action : Action ,
@@ -34,12 +36,12 @@ pub enum Trigger {
34
36
#[ derive( Serialize , Deserialize , Debug , Clone ) ]
35
37
#[ serde( rename_all = "camelCase" , tag = "type" , content = "subject" ) ]
36
38
pub enum Filter {
37
- /// Matches the file path (relative to the repository root) against all provided regex patterns .
39
+ /// Matches the file path (relative to the repository root).
38
40
#[ serde( with = "serde_regex" ) ]
39
- PathMatchesRegex ( Vec < regex:: Regex > ) ,
40
- /// Match the file content against all provided regex patterns .
41
+ PathMatchesRegex ( regex:: Regex ) ,
42
+ /// Match the file content.
41
43
#[ serde( with = "serde_regex" ) ]
42
- ContentMatchesRegex ( Vec < regex:: Regex > ) ,
44
+ ContentMatchesRegex ( regex:: Regex ) ,
43
45
/// Matches the file change operation type (e.g. addition, deletion, modification, rename)
44
46
FileChangeType ( TreeStatus ) ,
45
47
/// Matches the semantic type of the change.
0 commit comments