File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1078,19 +1078,11 @@ def format(
10781078 ) -> bool :
10791079 """Format all SQL models and audits."""
10801080 filtered_targets = [
1081- target
1082- for target in chain (self ._models .values (), self ._audits .values ())
1083- if target ._path is not None
1084- and target ._path .suffix == ".sql"
1081+ target for target in self ._models .values () | self ._audits .values ()
1082+ if target ._path is not None and target ._path .suffix == ".sql"
10851083 and (not paths or any (target ._path .samefile (p ) for p in paths ))
10861084 ]
1087- unformatted_file_paths = []
1088-
10891085 for target in filtered_targets :
1090- if (
1091- target ._path is None
1092- ): # introduced to satisfy type checker as still want to pull filter out as many targets as possible before loop
1093- continue
10941086 with open (target ._path , "r+" , encoding = "utf-8" ) as file :
10951087 before = file .read ()
10961088 expressions = parse (before , default_dialect = self .config_for_node (target ).dialect )
You can’t perform that action at this time.
0 commit comments