Giter VIP home page Giter VIP logo

Comments (7)

pksunkara avatar pksunkara commented on June 30, 2024 2

I can mentor on this issue.

from cargo-semver-checks.

pksunkara avatar pksunkara commented on June 30, 2024 1

To answer the original question,

Since we must respect the color choices set in various ways (as described in anstyle-query), we must bring in anstream. And then have a generic output function that uses anstyle-termcolor to convert the termcolor usage to anstyle before printing. This is the way people would choose to migrate if they have a lot of places where they need to migrate.

But since, we have only a few places and also use termcolor_output to currently print that we can't easily modify, and we are bringing in anstream anyway, I would recommend the refactor to anstream crate completely.

(Feel free to ping me on Zulip if you want to chat)

from cargo-semver-checks.

pksunkara avatar pksunkara commented on June 30, 2024 1

If you want to do that, I would recommend tracing instead (setup and usage)

from cargo-semver-checks.

suaviloquence avatar suaviloquence commented on June 30, 2024

Hi! Thanks for the offer to help! Would common practice be to use the anstyle-termcolor crate or refactor entirely to use the anstream crate?

from cargo-semver-checks.

pksunkara avatar pksunkara commented on June 30, 2024

I might be wrong but I consider anstyle-termcolor to be more related to style customization logic.

The color logic we need to clean up here is more about the setup including respecting user's preferences. I have a sample boilerplate for CLIs that sets up everything related to color at https://git.sr.ht/~pksunkara/cli-clap.

There are quite a few important parts such as:

from cargo-semver-checks.

suaviloquence avatar suaviloquence commented on June 30, 2024

just a thought while I work on this - does it make sense to also refactor to use something like the log crate for managing log levels?

so that the end application (the cli for us, and whatever binary crate uses semver-checks) sets color and logging preferences, and the library part of the crate is less aware of these preferences

from cargo-semver-checks.

suaviloquence avatar suaviloquence commented on June 30, 2024

Added in #737

from cargo-semver-checks.

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.