Run a single tool on the content and return the formatted string.
(
tool: &ResolvedTool,
content: &str,
file_path: &Path,
timeout: Duration,
)
| 296 | |
| 297 | /// Run a single tool on the content and return the formatted string. |
| 298 | fn run_tool( |
| 299 | tool: &ResolvedTool, |
| 300 | content: &str, |
| 301 | file_path: &Path, |
| 302 | timeout: Duration, |
| 303 | ) -> Result<String, String> { |
| 304 | match tool.name { |
| 305 | "php-cs-fixer" => run_php_cs_fixer(&tool.path, content, file_path, timeout), |
| 306 | "phpcbf" => run_phpcbf(&tool.path, content, file_path, timeout), |
| 307 | "pint" => run_pint(&tool.path, content, file_path, timeout), |
| 308 | _ => Err(format!("Unknown formatting tool: {}", tool.name)), |
| 309 | } |
| 310 | } |
| 311 | |
| 312 | /// Run php-cs-fixer on a sibling temp file and return the formatted content. |
| 313 | /// |
no test coverage detected