Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): correctly compute the color mode in ci #3244

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b

- Fix [#3201](https://github.com/biomejs/biome/issues/3201) by correctly injecting the source code of the file when printing the diagnostics. Contributed by @ematipico
- Fix [#3179](https://github.com/biomejs/biome/issues/3179) where comma separators are not correctly removed after running `biome migrate` and thus choke the parser. Contributed by @Sec-ant

- Fix [#3232](https://github.com/biomejs/biome/issues/3232) by correctly using the colors set by the user. Contributed by @ematipico
#### Enhancement

- Reword the reporter message `No fixes needed` to `No fixes applied`.
Expand Down
8 changes: 6 additions & 2 deletions crates/biome_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ fn main() -> ExitCode {

let color_mode = to_color_mode(command.get_color());
// we want force colours in CI, to give e better UX experience
if matches!(command, BiomeCommand::Ci { .. }) {
console.set_color(ColorMode::Enabled);
if let BiomeCommand::Ci { cli_options, .. } = &command {
if cli_options.colors.is_none() {
console.set_color(ColorMode::Enabled);
} else {
console.set_color(color_mode);
}
} else {
console.set_color(color_mode);
}
Expand Down