Merge commit '3d83740f88b6aaba6962256be517656496b83f25' into lsp-server

This commit is contained in:
csh
2026-05-24 13:04:22 +08:00
292 changed files with 30774 additions and 218828 deletions
@@ -26,14 +26,22 @@ class FormatMdActionTests(unittest.TestCase):
bin_dir = root / "bin"
bin_dir.mkdir()
prettier = bin_dir / "prettier"
prettier.write_text(
"#!/usr/bin/env python3\n"
"from pathlib import Path\n"
"Path(\".prettier_called\").write_text(\"ok\")\n",
encoding="utf-8",
)
prettier.chmod(0o755)
if os.name == "nt":
prettier = bin_dir / "prettier.cmd"
prettier.write_text(
"@echo off\r\n"
"echo ok> .prettier_called\r\n",
encoding="utf-8",
)
else:
prettier = bin_dir / "prettier"
prettier.write_text(
"#!/usr/bin/env python3\n"
"from pathlib import Path\n"
"Path(\".prettier_called\").write_text(\"ok\")\n",
encoding="utf-8",
)
prettier.chmod(0o755)
config_body = f"""
[playbook]
@@ -47,7 +55,7 @@ project_root = \"{tmp_dir}\"
config_path.write_text(config_body, encoding="utf-8")
env = os.environ.copy()
env["PATH"] = f"{bin_dir}:{env.get('PATH', '')}"
env["PATH"] = f"{bin_dir}{os.pathsep}{env.get('PATH', '')}"
result = run_cli("-config", str(config_path), env=env)
self.assertEqual(result.returncode, 0, msg=result.stderr)