@@ -22,14 +22,14 @@ class MixTestSettingsCommand(sublime_plugin.WindowCommand):
2222 def description (self ):
2323 return 'Opens the `mix test` settings file for the current project.'
2424
25- def run (self , ** kwargs ):
25+ def run (self , ** _kwargs ):
2626 abs_file_path = self .window .active_view ().file_name ()
2727 window_vars = self .window .extract_variables ()
2828 mix_settings_path = reverse_find_json_path (self .window , FILE_NAMES .SETTINGS_JSON )
2929
3030 if mix_settings_path :
3131 if not path .exists (mix_settings_path ):
32- save_json_settings (mix_settings_path , add_help_info ({'args' : []}))
32+ save_json_file (mix_settings_path , add_help_info ({'args' : []}))
3333 sublime_NewFileFlags_NONE = 4
3434 self .window .open_file (mix_settings_path , flags = sublime_NewFileFlags_NONE )
3535 else :
@@ -42,14 +42,14 @@ class MixTestCommand(sublime_plugin.WindowCommand):
4242 def description (self ):
4343 return 'Runs the full test-suite with `mix test`.'
4444
45- def run (self , ** kwargs ):
45+ def run (self , ** _kwargs ):
4646 call_mix_test_with_settings (self .window )
4747
4848class MixTestFileCommand (sublime_plugin .WindowCommand ):
4949 def description (self ):
5050 return 'Runs `mix test` on the current test file.'
5151
52- def run (self , ** kwargs ):
52+ def run (self , ** _kwargs ):
5353 abs_file_path = self .window .active_view ().file_name ()
5454 assert_is_test_file (abs_file_path )
5555 call_mix_test_with_settings (self .window , abs_file_path = abs_file_path )
@@ -156,18 +156,18 @@ class MixTestFailedCommand(sublime_plugin.WindowCommand):
156156 def description (self ):
157157 return 'Repeats only tests that failed the last time.'
158158
159- def run (self , ** kwargs ):
159+ def run (self , ** _kwargs ):
160160 call_mix_test_with_settings (self .window , failed = True )
161161
162162class MixTestRepeatCommand (sublime_plugin .WindowCommand ):
163163 def description (self ):
164164 return 'Repeats `mix test` with the last used parameters.'
165165
166- def run (self , ** kwargs ):
166+ def run (self , ** _kwargs ):
167167 json_path = reverse_find_json_path (self .window , path .join ('_build' , FILE_NAMES .REPEAT_JSON ))
168168
169169 if json_path :
170- call_mix_test_with_settings (self .window , ** load_json_settings (json_path ))
170+ call_mix_test_with_settings (self .window , ** load_json_file (json_path ))
171171 else :
172172 print_status_msg ('Error: No tests to repeat.' )
173173
@@ -180,7 +180,7 @@ def run(self, _edit, seed=None):
180180 if not mix_settings_path :
181181 return
182182
183- mix_params = load_json_settings (mix_settings_path )
183+ mix_params = load_json_file (mix_settings_path )
184184 seed = self .view .substr (self .view .sel ()[0 ]) if seed is None else seed
185185 seed = seed .strip () if type (seed ) == str else seed
186186 msg = None
@@ -193,7 +193,7 @@ def run(self, _edit, seed=None):
193193 msg = 'Erased mix test seed.'
194194 'seed' in mix_params and mix_params .pop ('seed' )
195195
196- save_json_settings (mix_settings_path , add_help_info (mix_params ))
196+ save_json_file (mix_settings_path , add_help_info (mix_params ))
197197
198198 print_status_msg (msg or 'Error: cannot set mix test seed to: %s' % repr (seed ))
199199
@@ -209,16 +209,16 @@ class MixTestToggleStaleFlagCommand(sublime_plugin.WindowCommand):
209209 def description (self ):
210210 return 'Toggles the --stale flag.'
211211
212- def run (self , ** kwargs ):
212+ def run (self , ** _kwargs ):
213213 mix_settings_path = reverse_find_json_path (self .window , FILE_NAMES .SETTINGS_JSON )
214214 if not mix_settings_path :
215215 return
216- mix_params = load_json_settings (mix_settings_path )
216+ mix_params = load_json_file (mix_settings_path )
217217 args = mix_params .get ('args' , [])
218218 has_stale_flag = '--stale' in args
219219 args = [a for a in args if a != '--stale' ] if has_stale_flag else args + ['--stale' ]
220220 mix_params ['args' ] = args
221- save_json_settings (mix_settings_path , mix_params )
221+ save_json_file (mix_settings_path , mix_params )
222222 print_status_msg ('%s mix test --stale flag!' % ['Added' , 'Removed' ][has_stale_flag ])
223223
224224
@@ -242,6 +242,8 @@ def get_test_block_regions(view, header_region, lookup_table):
242242 point , view_size = name_region .b , view .size ()
243243 begin_scopes_counter = 0
244244
245+ # TODO: use view.expand_to_scope() when available?
246+
245247 while point < view_size :
246248 token_region = view .extract_scope (point )
247249 token_str = view .substr (token_region )
@@ -390,9 +392,9 @@ def call_mix_test_with_settings(window, **params):
390392 params .setdefault ('file_path' , path .relpath (params ['abs_file_path' ], root_dir ))
391393 del params ['abs_file_path' ]
392394
393- save_json_settings (path .join (build_dir , FILE_NAMES .REPEAT_JSON ), params )
395+ save_json_file (path .join (build_dir , FILE_NAMES .REPEAT_JSON ), params )
394396
395- mix_params = load_json_settings (mix_settings_path )
397+ mix_params = load_json_file (mix_settings_path )
396398 mix_params = remove_help_info (mix_params )
397399 mix_params .update (params )
398400 mix_params .setdefault ('cwd' , root_dir )
0 commit comments