@@ -79,7 +79,7 @@ def test_validate_success(self, runner, sample_project):
7979 """Test validating a valid project succeeds."""
8080 result = runner .invoke (
8181 main ,
82- ["validate" , str ( sample_project ), " --telemetry" , "none" ],
82+ ["--telemetry" , "none" , "validate" , str ( sample_project ) ],
8383 )
8484
8585 # Should exit with code 0 for success
@@ -90,11 +90,11 @@ def test_validate_with_streaming(self, runner, sample_project):
9090 result = runner .invoke (
9191 main ,
9292 [
93+ "--telemetry" ,
94+ "none" ,
9395 "validate" ,
9496 str (sample_project ),
9597 "--enable-streaming" ,
96- "--telemetry" ,
97- "none" ,
9898 ],
9999 )
100100
@@ -105,7 +105,7 @@ def test_validate_nonexistent_path(self, runner, tmp_path):
105105 nonexistent = tmp_path / "does-not-exist"
106106
107107 result = runner .invoke (
108- main , ["validate" , str ( nonexistent ), " --telemetry" , "none" ]
108+ main , ["--telemetry" , "none" , "validate" , str ( nonexistent ) ]
109109 )
110110
111111 # Should exit with non-zero code
@@ -114,7 +114,7 @@ def test_validate_nonexistent_path(self, runner, tmp_path):
114114 def test_validate_output_contains_result (self , runner , sample_project ):
115115 """Test that validate output contains meaningful results."""
116116 result = runner .invoke (
117- main , ["validate" , str ( sample_project ), " --telemetry" , "none" ]
117+ main , ["--telemetry" , "none" , "validate" , str ( sample_project ) ]
118118 )
119119
120120 # Output should mention validation results
@@ -143,14 +143,14 @@ def test_validate_with_custom_schemas(self, runner, tmp_path):
143143 result = runner .invoke (
144144 main ,
145145 [
146+ "--telemetry" ,
147+ "none" ,
146148 "validate" ,
147149 str (project ),
148150 "--schemas-dir" ,
149151 str (custom_schemas ),
150152 "--guardrails-dir" ,
151153 str (guardrails ),
152- "--telemetry" ,
153- "none" ,
154154 ],
155155 )
156156
@@ -207,8 +207,7 @@ class TestLintCommand:
207207 def test_lint_success (self , runner , sample_project ):
208208 """Test linting a valid project."""
209209 result = runner .invoke (
210- main ,
211- ["lint" , str (sample_project ), "--telemetry" , "none" ],
210+ main , ["--telemetry" , "none" , "lint" , str (sample_project )],
212211 )
213212
214213 # Should complete successfully
@@ -219,12 +218,12 @@ def test_lint_with_options(self, runner, sample_project):
219218 result = runner .invoke (
220219 main ,
221220 [
221+ "--telemetry" ,
222+ "none" ,
222223 "lint" ,
223224 str (sample_project ),
224225 "--check-indentation" ,
225226 "--check-attribute-order" ,
226- "--telemetry" ,
227- "none" ,
228227 ],
229228 )
230229
@@ -238,7 +237,7 @@ def test_lint_detects_issues(self, runner, tmp_path):
238237 '<?xml version="1.0"?>\n <root attr2="b" attr1="a">\n <child/>\n </root>'
239238 )
240239
241- result = runner .invoke (main , ["lint" , str ( tmp_path ), " --telemetry" , "none" ])
240+ result = runner .invoke (main , ["--telemetry" , "none" , "lint" , str ( tmp_path ) ])
242241
243242 # Should complete (may or may not report issues depending on linter strictness)
244243 assert result .exit_code in [0 , 1 ]
@@ -257,7 +256,7 @@ def test_diff_identical_files(self, runner, tmp_path):
257256 file2 .write_text (xml_content )
258257
259258 result = runner .invoke (
260- main , ["diff" , str (file1 ), str (file2 ), "--telemetry" , "none" ]
259+ main , ["--telemetry" , "none" , " diff" , str (file1 ), str (file2 )]
261260 )
262261
263262 # Should complete successfully
@@ -272,7 +271,7 @@ def test_diff_different_files(self, runner, tmp_path):
272271 file2 .write_text ("<root><child>content2</child></root>" )
273272
274273 result = runner .invoke (
275- main , ["diff" , str (file1 ), str (file2 ), "--telemetry" , "none" ]
274+ main , ["--telemetry" , "none" , " diff" , str (file1 ), str (file2 )]
276275 )
277276
278277 # Should complete and show differences
@@ -431,12 +430,12 @@ def test_telemetry_file(self, runner, sample_project, tmp_path):
431430 result = runner .invoke (
432431 main ,
433432 [
434- "validate" ,
435- str (sample_project ),
436433 "--telemetry" ,
437434 "file" ,
438435 "--telemetry-target" ,
439436 str (telemetry_file ),
437+ "validate" ,
438+ str (sample_project ),
440439 ],
441440 )
442441
@@ -446,7 +445,7 @@ def test_telemetry_file(self, runner, sample_project, tmp_path):
446445 def test_telemetry_none (self , runner , sample_project ):
447446 """Test validation with no telemetry."""
448447 result = runner .invoke (
449- main , ["validate" , str ( sample_project ), " --telemetry" , "none" ]
448+ main , ["--telemetry" , "none" , "validate" , str ( sample_project ) ]
450449 )
451450
452451 assert result .exit_code == 0
@@ -459,7 +458,7 @@ def test_validate_then_publish_workflow(self, runner, sample_project, tmp_path):
459458 """Test a complete validate -> publish workflow."""
460459 # First validate
461460 validate_result = runner .invoke (
462- main , ["validate" , str ( sample_project ), " --telemetry" , "none" ]
461+ main , ["--telemetry" , "none" , "validate" , str ( sample_project ) ]
463462 )
464463
465464 # Then publish
@@ -483,12 +482,12 @@ def test_validate_and_lint_workflow(self, runner, sample_project):
483482 """Test validate and lint commands on the same project."""
484483 # Validate
485484 validate_result = runner .invoke (
486- main , ["validate" , str ( sample_project ), " --telemetry" , "none" ]
485+ main , ["--telemetry" , "none" , "validate" , str ( sample_project ) ]
487486 )
488487
489488 # Lint
490489 lint_result = runner .invoke (
491- main , ["lint" , str ( sample_project ), " --telemetry" , "none" ]
490+ main , ["--telemetry" , "none" , "lint" , str ( sample_project ) ]
492491 )
493492
494493 # Both should complete successfully
0 commit comments