@@ -29,7 +29,7 @@ def _path_entry_has_dylint_or_rustup(entry: str) -> bool:
2929
3030
3131def _run_lint (
32- tmp_path : Path , * , ci : bool
32+ tmp_path : Path , * , ci : bool , args : tuple [ str , ...] = ()
3333) -> tuple [subprocess .CompletedProcess [str ], list [str ]]:
3434 bin_dir = tmp_path / "bin"
3535 bin_dir .mkdir ()
@@ -58,7 +58,7 @@ def _run_lint(
5858 env .pop ("CI" , None )
5959
6060 result = subprocess .run (
61- ["bash" , str (REPO_ROOT / "lint" )],
61+ ["bash" , str (REPO_ROOT / "lint" ), * args ],
6262 cwd = REPO_ROOT ,
6363 env = env ,
6464 capture_output = True ,
@@ -120,6 +120,13 @@ def test_missing_dylint_is_a_hard_failure_in_ci(tmp_path: Path) -> None:
120120 assert _log_has_match (log_lines , r"^uv (run )?pyright src tests ci$" )
121121
122122
123+ def test_explicit_skip_keeps_other_lints_but_does_not_run_dylint (tmp_path : Path ) -> None :
124+ result , log_lines = _run_lint (tmp_path , ci = True , args = ("--skip-dylint" ,))
125+ assert result .returncode == 0
126+ assert any (line .startswith ("soldr cargo clippy" ) for line in log_lines )
127+ assert not any ("dylint" in line for line in log_lines )
128+
129+
123130def test_python_stages_precede_the_rust_stages (tmp_path : Path ) -> None :
124131 _result , log_lines = _run_lint (tmp_path , ci = False )
125132
@@ -144,10 +151,18 @@ def test_python_stages_precede_the_rust_stages(tmp_path: Path) -> None:
144151 "windows-x86-lint.yml" ,
145152 ],
146153)
147- def test_native_dylint_runs_on_unlabelled_pr (workflow : str ) -> None :
154+ def test_native_lint_without_dylint_runs_on_unlabelled_pr (workflow : str ) -> None :
148155 source = (REPO_ROOT / ".github" / "workflows" / workflow ).read_text (
149156 encoding = "utf-8"
150157 )
151158 assert "pull_request:" in source
152159 assert "uses: ./.github/workflows/_lint.yml" in source
160+ assert "run-dylint: true" not in source
153161 assert "contains(github.event.pull_request.labels.*.name, 'ci-full')" not in source
162+
163+
164+ def test_only_linux_x86_runs_unified_dylint () -> None :
165+ source = (REPO_ROOT / ".github" / "workflows" / "linux-x86-lint.yml" ).read_text (
166+ encoding = "utf-8"
167+ )
168+ assert "run-dylint: true" in source
0 commit comments