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

make '--color=yes' the default #122

Merged
merged 4 commits into from
May 7, 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: 2 additions & 0 deletions src/server.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ function _exeflags_and_env(options)
if !any(startswith("JULIA_PROJECT="), env) && !any(startswith("--project="), exeflags)
push!(exeflags, "--project=@.")
end
# if exeflags already contains '--color=no', the 'no' will prevail
pushfirst!(exeflags, "--color=yes")
return exeflags, env
end

Expand Down
4 changes: 3 additions & 1 deletion test/examples/project.qmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
title: Project
julia:
exeflags: ["--color=no"]
---

Non-global project environment.
Expand Down Expand Up @@ -27,4 +29,4 @@ using Example

```{julia}
isa(Example, Module)
```
```
4 changes: 3 additions & 1 deletion test/examples/project/dir/project_default.qmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
title: Project
julia:
exeflags: ["--color=no"]
---

Non-global project environment.
Expand All @@ -22,4 +24,4 @@ using Example

```{julia}
isa(Example, Module)
```
```
4 changes: 3 additions & 1 deletion test/examples/project/project_default.qmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
title: Project
julia:
exeflags: ["--color=no"]
---

Non-global project environment.
Expand All @@ -22,4 +24,4 @@ using Example

```{julia}
isa(Example, Module)
```
```
3 changes: 2 additions & 1 deletion test/examples/project_env.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Project
julia:
env: ["JULIA_PROJECT=project"]
exeflags: ["--color=no"]
---

Non-global project environment.
Expand All @@ -24,4 +25,4 @@ using Example

```{julia}
isa(Example, Module)
```
```
4 changes: 2 additions & 2 deletions test/examples/project_exeflags.qmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Project
julia:
exeflags: ["--project=project"]
exeflags: ["--project=project", "--color=no"]
---

Non-global project environment.
Expand All @@ -24,4 +24,4 @@ using Example

```{julia}
isa(Example, Module)
```
```
6 changes: 3 additions & 3 deletions test/testsets/env_and_exeflags.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ test_example(joinpath(@__DIR__, "../examples/env_and_exeflags.qmd")) do json
@test cell["outputs"][1]["data"]["text/plain"] == "\"BAR\""

cell = cells[4]
@test cell["outputs"][1]["text"] == "red"
@test cell["outputs"][1]["text"] == "\e[31mred\e[39m"
end

withenv("QUARTONOTEBOOKRUNNER_EXEFLAGS" => """["--color=yes"]""") do
withenv("QUARTONOTEBOOKRUNNER_EXEFLAGS" => """["--color=no"]""") do
test_example(joinpath(@__DIR__, "../examples/env_and_exeflags.qmd")) do json
cells = json["cells"]
@test length(cells) == 4
Expand All @@ -20,6 +20,6 @@ withenv("QUARTONOTEBOOKRUNNER_EXEFLAGS" => """["--color=yes"]""") do
@test cell["outputs"][1]["data"]["text/plain"] == "\"BAR\""

cell = cells[4]
@test cell["outputs"][1]["text"] == "\e[31mred\e[39m"
@test cell["outputs"][1]["text"] == "red"
end
end
Loading