Git Product home page Git Product logo

Comments (4)

bhb avatar bhb commented on July 22, 2024 1

@vemv I haven't dug in, but off the top of my head, I think it'd require some pretty in-depth design on a number of parts of error messages, including

  1. How to highlight the bad value when it's part of a larger value
  2. How to handle multiple branches of or specs
  3. How to print out tables of missing keys

Just fair warning - you're welcome to make a PR, but I think the bar for this change is pretty high and I'll probably politely decline the PR unless it works across the range of features that Expound includes 😄 .

from expound.

bhb avatar bhb commented on July 22, 2024

@vemv Hi, thanks very much for your question!

There is not currently an option to remove the newlines and separators. The error messages in Expound rely on whitespace (including newlines) in a number of cases. For instance, in the following example, the error message relies on newlines to underline the bad part of the map:

;; -- Spec failed --------------------

;;   {:city ..., :state :CO}
;;                      ^^^

;; should satisfy

;;   string?

I can certainly understand why messages without newlines would be useful in your context, but Expound's error messages are intentionally multi-line and verbose to assist with understanding.

A different set of messages that are single-line and compact would be also useful, but out of scope for this particular project.

Thanks!

from expound.

vemv avatar vemv commented on July 22, 2024

Thanks for the explanation @bhb !

I might give a shot to a PR, assuming the changes aren't too intrusive.

from expound.

vemv avatar vemv commented on July 22, 2024

Again, thanks for the fair warning!

I gave some thought to your feedback.

Probably plain data could do the job:

{:bad-value "X"
 :bad-value-path [0 0 :foo 0] ;; get-in style
 :missing-keys [:x :y :z]
 :branches [...]
 ...
}

Something like that. With a bit of luck, expound could build this data structure first, and present its traditional informational messages on top of that.

It doesn't sound easy but I had been wanting to allocate a day to FOSS!

from expound.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.