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

feat(renderer): add NO_COLOR and TERM support to Config #8

Merged
merged 2 commits into from
Jan 7, 2024

Conversation

johnyob
Copy link
Owner

@johnyob johnyob commented Jan 4, 2024

Grace's renderer will now infer NO_COLOR and TERM for Config.default.

Behaviour

No color

$ NO_COLOR=1 dune exec main
error: `match` cases have incompatible types # <-- this is bold
    ┌─ fizz.ml:7:13
  2 │    let fizz n = 
  3 │ ╭──  match n mod 5, n mod 3 with
  4 │ │    | 0, 0 -> `Fizz_buzz
    │ │              ---------- this is found to be of type `[> `Fizz_buzz]`
  5 │ │    | 0, _ -> `Fizz
    │ │              ----- this is found to be of type `[> `Fizz]`
  6 │ │    | _, 0 -> `Buzz
    │ │              ----- this is found to be of type `[> `Buzz]`
  7 │ │    | _, _ -> n
    │ │              ^ expected `[> `Buzz | `Fizz | `Fizz_buzz]`, found `int`
    │ ╰──────────────' `match` cases have incompatible types
  8 │    ;;

No highlighting or color

$ TERM=dumb dune exec main
error: `match` cases have incompatible types
    ┌─ fizz.ml:7:13
  2 │    let fizz n = 
  3 │ ╭──  match n mod 5, n mod 3 with
  4 │ │    | 0, 0 -> `Fizz_buzz
    │ │              ---------- this is found to be of type `[> `Fizz_buzz]`
  5 │ │    | 0, _ -> `Fizz
    │ │              ----- this is found to be of type `[> `Fizz]`
  6 │ │    | _, 0 -> `Buzz
    │ │              ----- this is found to be of type `[> `Buzz]`
  7 │ │    | _, _ -> n
    │ │              ^ expected `[> `Buzz | `Fizz | `Fizz_buzz]`, found `int`
    │ ╰──────────────' `match` cases have incompatible types
  8 │    ;;

@johnyob johnyob merged commit b109ae7 into main Jan 7, 2024
8 checks passed
johnyob added a commit to johnyob/opam-repository that referenced this pull request May 28, 2024
CHANGES:

* fix(renderer): remove uncessary underlines when printing a unique 'multi-line `Top` marker' ([johnyob/grace#31](johnyob/grace#31))
* fix(renderer): replace unicode chars with ASCII in `Config.ascii` ([johnyob/grace#27](johnyob/grace#27))
* feat(renderer): add `NO_COLOR` and `TERM` support to `Config` ([johnyob/grace#8](johnyob/grace#8))
* feat(core,renderer): add support for error codes ([johnyob/grace#30](johnyob/grace#30))
* feat(renderer): add support for UTF8 encoding 🚀 ([johnyob/grace#25](johnyob/grace#25))
* feat(renderer): re-introduce support for compact diagnostic rendering ([johnyob/grace#28](johnyob/grace#28))
* refactor(renderer)!: move `grace.renderer` library to `grace.ansi_renderer` ([johnyob/grace#29](johnyob/grace#29))

### BREAKING CHANGE

* `Grace_rendering` has been removed. Use `Grace_ansi_renderer` instead.
johnyob added a commit to johnyob/opam-repository that referenced this pull request May 30, 2024
CHANGES:

* fix(renderer): remove uncessary underlines when printing a unique 'multi-line `Top` marker' ([johnyob/grace#31](johnyob/grace#31))
* fix(renderer): replace unicode chars with ASCII in `Config.ascii` ([johnyob/grace#27](johnyob/grace#27))
* feat(renderer): add `NO_COLOR` and `TERM` support to `Config` ([johnyob/grace#8](johnyob/grace#8))
* feat(core,renderer): add support for error codes ([johnyob/grace#30](johnyob/grace#30))
* feat(renderer): add support for UTF8 encoding 🚀 ([johnyob/grace#25](johnyob/grace#25))
* feat(renderer): re-introduce support for compact diagnostic rendering ([johnyob/grace#28](johnyob/grace#28))
* refactor(renderer)!: move `grace.renderer` library to `grace.ansi_renderer` ([johnyob/grace#29](johnyob/grace#29))

### BREAKING CHANGE

* `Grace_rendering` has been removed. Use `Grace_ansi_renderer` instead.
avsm pushed a commit to avsm/opam-repository that referenced this pull request Sep 5, 2024
CHANGES:

* fix(renderer): remove uncessary underlines when printing a unique 'multi-line `Top` marker' ([johnyob/grace#31](johnyob/grace#31))
* fix(renderer): replace unicode chars with ASCII in `Config.ascii` ([johnyob/grace#27](johnyob/grace#27))
* feat(renderer): add `NO_COLOR` and `TERM` support to `Config` ([johnyob/grace#8](johnyob/grace#8))
* feat(core,renderer): add support for error codes ([johnyob/grace#30](johnyob/grace#30))
* feat(renderer): add support for UTF8 encoding 🚀 ([johnyob/grace#25](johnyob/grace#25))
* feat(renderer): re-introduce support for compact diagnostic rendering ([johnyob/grace#28](johnyob/grace#28))
* refactor(renderer)!: move `grace.renderer` library to `grace.ansi_renderer` ([johnyob/grace#29](johnyob/grace#29))

### BREAKING CHANGE

* `Grace_rendering` has been removed. Use `Grace_ansi_renderer` instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant