Giter VIP home page Giter VIP logo

Comments (3)

SergioBenitez avatar SergioBenitez commented on August 21, 2024

I don't think we should make any decisions for the user here. They should be able to (or be able not to) conform to any standard or non-standard they want. But I don't quite understand your example. Can you be specific, perhaps with code?

from yansi.

epage avatar epage commented on August 21, 2024

Let's break apart the users involved

  • User running a program
  • Program author
  • Test crate author

Ultimately, the color policy is left for the program author to decide but generally will follow a standard the user running the program expects.

Now, a crate author might try to make testing easier, and want colored output to help, like pretty_assertions. The program author would then be using this as part of their testing. The user running the program never sees this.

Options for test tool crates, like pretty_assertions

  • Hard code colors on
  • Put colors behind a feature flag
  • Use a once_cell to call color detection code and store the value

Rather than every test crate handling this on their own, what if we provided a feature flag that had logic from #18 in it and would ensure we do the "right thing" in these cases.

from yansi.

SergioBenitez avatar SergioBenitez commented on August 21, 2024

I don't think conforming to a variety of standards should be yansi's prerogative. I don't want yansi to be opinionated here: I want it to fit every use-case. If another crate wants to provide utilities that conform to these standards, then that's totally great. But I think we should leave it to other crates.

from yansi.

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.