@@ -150,36 +150,32 @@ def status(ctx, group, status, endpoints, format, targets):
150150 fs = CachedFilesystem ()
151151 graph = Graph .from_targets (workflow .targets , fs )
152152
153- with (
154- create_backend (
155- ctx .backend , working_dir = ctx .working_dir , config = ctx .config
156- ) as backend ,
157- get_spec_hashes (working_dir = ctx .working_dir , config = ctx .config ) as spec_hashes ,
158- ):
159- target_states = get_status_map (
160- graph ,
161- fs ,
162- spec_hashes ,
163- backend ,
164- )
153+ with create_backend (ctx .backend , working_dir = ctx .working_dir , config = ctx .config ) as backend :
154+ with get_spec_hashes (working_dir = ctx .working_dir , config = ctx .config ) as spec_hashes :
155+ target_states = get_status_map (
156+ graph ,
157+ fs ,
158+ spec_hashes ,
159+ backend ,
160+ )
165161
166- filters = []
167- if status :
168- filters .append (
169- StatusFilter (
170- status_provider = target_states .get ,
171- status = _status_names_to_enums (status ),
162+ filters = []
163+ if status :
164+ filters .append (
165+ StatusFilter (
166+ status_provider = target_states .get ,
167+ status = _status_names_to_enums (status ),
168+ )
172169 )
173- )
174- if targets :
175- filters .append (NameFilter (patterns = targets ))
176- if endpoints :
177- filters .append (EndpointFilter (endpoints = graph .endpoints ()))
178- if group :
179- filters .append (GroupFilter (patterns = group ))
180-
181- matches = set (filter_generic (targets = graph , filters = filters ))
182- target_states = {k : v for k , v in target_states .items () if k in matches }
183-
184- printer = FORMATS [format ]
185- printer (target_states , backend )
170+ if targets :
171+ filters .append (NameFilter (patterns = targets ))
172+ if endpoints :
173+ filters .append (EndpointFilter (endpoints = graph .endpoints ()))
174+ if group :
175+ filters .append (GroupFilter (patterns = group ))
176+
177+ matches = set (filter_generic (targets = graph , filters = filters ))
178+ target_states = {k : v for k , v in target_states .items () if k in matches }
179+
180+ printer = FORMATS [format ]
181+ printer (target_states , backend )
0 commit comments