From f169521059dae51ccc8890d6a516e9a2ddfc4d34 Mon Sep 17 00:00:00 2001 From: wuyangfan Date: Fri, 19 Jun 2026 19:00:31 +0800 Subject: [PATCH 1/3] fix(check): preserve oxlint github reporter --- packages/cli/binding/src/check/analysis.rs | 19 ++++++++++++++++++- packages/cli/binding/src/check/mod.rs | 6 ------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/packages/cli/binding/src/check/analysis.rs b/packages/cli/binding/src/check/analysis.rs index 6068b1a866..20136df379 100644 --- a/packages/cli/binding/src/check/analysis.rs +++ b/packages/cli/binding/src/check/analysis.rs @@ -247,7 +247,7 @@ pub(super) fn analyze_lint_output(output: &str) -> Option Date: Mon, 22 Jun 2026 06:04:04 +0800 Subject: [PATCH 2/3] fix(check): keep lint output parseable for agents --- packages/cli/binding/src/check/mod.rs | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/packages/cli/binding/src/check/mod.rs b/packages/cli/binding/src/check/mod.rs index 9f6c54dac4..2eb7450cb3 100644 --- a/packages/cli/binding/src/check/mod.rs +++ b/packages/cli/binding/src/check/mod.rs @@ -138,6 +138,8 @@ pub(crate) async fn execute_check( if fix && lint_enabled { args.push("--fix".to_string()); } + let lint_format = if is_github_actions_env(envs) { "github" } else { "default" }; + args.push(format!("--format={lint_format}")); if !lint_enabled && type_check_enabled { args.push("--type-check-only".to_string()); } @@ -271,6 +273,10 @@ fn flush_deferred_pass_lines( } } +fn is_github_actions_env(envs: &FxHashMap, Arc>) -> bool { + envs.get(OsStr::new("GITHUB_ACTIONS")).is_some_and(|value| value.as_ref() == OsStr::new("true")) +} + /// Combine stdout and stderr from a captured command output. fn combine_output(captured: CapturedCommandOutput) -> (ExitStatus, String) { let combined = if captured.stderr.is_empty() { @@ -282,3 +288,26 @@ fn combine_output(captured: CapturedCommandOutput) -> (ExitStatus, String) { }; (captured.status, combined) } + +#[cfg(test)] +mod tests { + use std::{ffi::OsStr, sync::Arc}; + + use rustc_hash::FxHashMap; + + use super::is_github_actions_env; + + fn envs(entries: &[(&str, &str)]) -> FxHashMap, Arc> { + entries + .iter() + .map(|(key, value)| (Arc::from(OsStr::new(key)), Arc::from(OsStr::new(value)))) + .collect() + } + + #[test] + fn github_actions_env_requires_true_value() { + assert!(is_github_actions_env(&envs(&[("GITHUB_ACTIONS", "true")]))); + assert!(!is_github_actions_env(&envs(&[("GITHUB_ACTIONS", "false")]))); + assert!(!is_github_actions_env(&envs(&[]))); + } +} From 3c9add18993e1b092ba93ecd25dfe55a3729d8db Mon Sep 17 00:00:00 2001 From: wuyangfan Date: Mon, 22 Jun 2026 16:18:36 +0800 Subject: [PATCH 3/3] fix(check): remove forced oxlint default reporter --- packages/cli/binding/src/check/analysis.rs | 19 +------------- packages/cli/binding/src/check/mod.rs | 29 ---------------------- 2 files changed, 1 insertion(+), 47 deletions(-) diff --git a/packages/cli/binding/src/check/analysis.rs b/packages/cli/binding/src/check/analysis.rs index 20136df379..6068b1a866 100644 --- a/packages/cli/binding/src/check/analysis.rs +++ b/packages/cli/binding/src/check/analysis.rs @@ -247,7 +247,7 @@ pub(super) fn analyze_lint_output(output: &str) -> Option, Arc>) -> bool { - envs.get(OsStr::new("GITHUB_ACTIONS")).is_some_and(|value| value.as_ref() == OsStr::new("true")) -} - /// Combine stdout and stderr from a captured command output. fn combine_output(captured: CapturedCommandOutput) -> (ExitStatus, String) { let combined = if captured.stderr.is_empty() { @@ -288,26 +282,3 @@ fn combine_output(captured: CapturedCommandOutput) -> (ExitStatus, String) { }; (captured.status, combined) } - -#[cfg(test)] -mod tests { - use std::{ffi::OsStr, sync::Arc}; - - use rustc_hash::FxHashMap; - - use super::is_github_actions_env; - - fn envs(entries: &[(&str, &str)]) -> FxHashMap, Arc> { - entries - .iter() - .map(|(key, value)| (Arc::from(OsStr::new(key)), Arc::from(OsStr::new(value)))) - .collect() - } - - #[test] - fn github_actions_env_requires_true_value() { - assert!(is_github_actions_env(&envs(&[("GITHUB_ACTIONS", "true")]))); - assert!(!is_github_actions_env(&envs(&[("GITHUB_ACTIONS", "false")]))); - assert!(!is_github_actions_env(&envs(&[]))); - } -}