@@ -50,6 +50,7 @@ def __init__(self, globs: GlobPatterns) -> None:
5050 self .move = {
5151 key : re .compile (fnmatch .translate (key ), re .I ) for key in globs .move
5252 }
53+ self .ignore = OptionalRegexPattern (globs .ignore )
5354
5455 def move_match (self , value : str ) -> str | None :
5556 """
@@ -79,6 +80,7 @@ class GlobPatterns:
7980 valid : list [str ] | None = None
8081 delete : list [str ] | None = None
8182 move : dict [str , str ] = field (default_factory = dict [str , str ])
83+ ignore : list [str ] | None = None
8284
8385 def merge (
8486 self , other : GlobPatterns , mode : Literal ["merge" , "replace" ] = "replace"
@@ -106,13 +108,15 @@ def merge(
106108 valid = _merge_list (self .valid , other .valid ),
107109 delete = _merge_list (self .delete , other .delete ),
108110 move = self .move | other .move ,
111+ ignore = _merge_list (self .ignore , other .ignore ),
109112 )
110113 else :
111114 return GlobPatterns (
112115 unfold = other .unfold or self .unfold ,
113116 valid = other .valid or self .valid ,
114117 delete = other .delete or self .delete ,
115118 move = other .move or self .move ,
119+ ignore = other .ignore or self .ignore ,
116120 )
117121
118122
@@ -125,6 +129,8 @@ class BasicModDataChecker(mobase.ModDataChecker):
125129
126130 Args:
127131 file_patterns (optional): A GlobPatterns object, with the following attributes:
132+ ignore: [ "list of files and folders to ignore." ]
133+ # Check result: unchanged
128134 unfold: [ "list of folders to unfold" ],
129135 # (remove and move contents to parent), after being checked and
130136 # fixed recursively.
@@ -175,6 +181,8 @@ def dataLooksValid(
175181 for entry in filetree :
176182 name = entry .name ().casefold ()
177183
184+ if rp .ignore .match (name ):
185+ continue
178186 if rp .unfold .match (name ):
179187 if is_directory (entry ):
180188 status = self .dataLooksValid (entry )
@@ -196,6 +204,8 @@ def fix(self, filetree: mobase.IFileTree) -> mobase.IFileTree:
196204 for entry in list (filetree ):
197205 name = entry .name ()
198206
207+ if rp .ignore .match (name ):
208+ continue
199209 # unfold first - if this match, entry is a directory (checked in
200210 # dataLooksValid)
201211 if rp .unfold .match (name ):
0 commit comments