1111from mergify_cli import utils
1212from mergify_cli .ci .scopes import base_detector
1313from mergify_cli .ci .scopes import changed_files
14+ from mergify_cli .ci .scopes import exceptions
1415
1516
1617if typing .TYPE_CHECKING :
2122SCOPE_NAME_RE = r"^[A-Za-z0-9_-]+$"
2223
2324
24- class ScopesError (Exception ):
25- pass
26-
27-
28- class ConfigInvalidError (ScopesError ):
29- pass
30-
31-
32- class ChangedFilesError (ScopesError ):
25+ class ConfigInvalidError (exceptions .ScopesError ):
3326 pass
3427
3528
@@ -111,7 +104,7 @@ def maybe_write_github_outputs(
111104 fh .write (f"{ key } ={ val } \n " )
112105
113106
114- class InvalidDetectedScopeError (ScopesError ):
107+ class InvalidDetectedScopeError (exceptions . ScopesError ):
115108 pass
116109
117110
@@ -135,10 +128,7 @@ def load_from_file(cls, filename: str) -> DetectedScope:
135128def detect (config_path : str ) -> DetectedScope :
136129 cfg = Config .from_yaml (config_path )
137130 base = base_detector .detect ()
138- try :
139- changed = changed_files .git_changed_files (base .ref )
140- except changed_files .ChangedFilesError as e :
141- raise ChangedFilesError (str (e ))
131+ changed = changed_files .git_changed_files (base .ref )
142132 scopes_hit , per_scope = match_scopes (cfg , changed )
143133
144134 all_scopes = set (cfg .scopes .keys ())
0 commit comments