Git Product home page Git Product logo

Comments (14)

JSSAggie avatar JSSAggie commented on May 26, 2024 1

image

Would this add the ability to turn off the colors? If so I am all for it. We are pulling the breaking changes into our API spec pul requests and the color values in the error messages are not helping (:

from oasdiff.

reuvenharrison avatar reuvenharrison commented on May 26, 2024 1

The latest release adds support for color=auto|always|never
Your feedback is welcome.

from oasdiff.

EpicWink avatar EpicWink commented on May 26, 2024

CI usually does not have stdout be a TTY, so my proposal would default to no colours in that case

from oasdiff.

reuvenharrison avatar reuvenharrison commented on May 26, 2024

@JSSAggie oasdiff automatically disables colored output when it detects piped output so you can easily remove the colors as follows:
oasdiff breaking spec1 spec2 | cat
or
oasdiff changelog spec1 spec2 | cat

from oasdiff.

JSSAggie avatar JSSAggie commented on May 26, 2024

I still think the flag is valuable. We can pipe out to a json file in the meantime.

from oasdiff.

reuvenharrison avatar reuvenharrison commented on May 26, 2024

Hi @JSSAggie,
#386 will remove color codes from json and yaml output.
Does this address your requirement?

from oasdiff.

JSSAggie avatar JSSAggie commented on May 26, 2024

Looks like that will do it. Thanks

from oasdiff.

ls-jad-elkik avatar ls-jad-elkik commented on May 26, 2024

It's unclear to me if the -color always suggestion was actually implemented in the linked PR.

I would find this helpful since in our CI we'd like to oasdiff breaking ... | tee artifacts/diff.txt to be able to process that txt file later on while still showing colors in the CI step itself. So the auto-detection of a TTY with no override is backfiring in our case.

from oasdiff.

reuvenharrison avatar reuvenharrison commented on May 26, 2024

Hi @ls-jad-elkik,
We haven't yet implemented -color always.
As of now oasdiff only adds ANSI Color Escape Sequences if the output is not piped.
I would recommend running oasdiff twice as a temporary workaround, once with output to the CI step and once again to store the artifact.

In preparation for a proper solution, could you clarify whether you expect artifacts/diff.txt to contain colors or not?

from oasdiff.

ls-jad-elkik avatar ls-jad-elkik commented on May 26, 2024

Hi @reuvenharrison,

We're going to be using the workaround. The idea was to maybe strip the color codes before storing the artifact, because along with colors the indentation is gone when tty detection kicks in. And indentation is also important to make it readable.

I don't think it's a very critical feature, but it's kind of standard to either have that --color=[auto|always|off] flag or COLOR=XXX env var or FORCE_COLOR env var, etc.

Thanks for the quick reply and clarification.

from oasdiff.

reuvenharrison avatar reuvenharrison commented on May 26, 2024

We will add --color=[auto|always|never]
Thanks for your input!

from oasdiff.

EpicWink avatar EpicWink commented on May 26, 2024

Ahh, I didn't specify which commands I would like to see coloured output in the original request. diff I think would also benefit from colours

from oasdiff.

reuvenharrison avatar reuvenharrison commented on May 26, 2024

Hi @EpicWink,
Which format of the diff report are you using? json, text, html, or yaml?
The json and yaml formats provide a low-level diff report which is not ideal for human-readers.
The diff report in text or html formats is easier to read.
But the best report for humans is the changelog.

It would be useful to understand this and also the general use-case: how you use the diff output?

By the way, you are welcome to join our slack community where we can discuss this privately:
https://join.slack.com/t/oasdiff/shared_invite/zt-1wvo7wois-ttncNBmyjyRXqBzyg~P6oA

Thanks,
Reuven

from oasdiff.

EpicWink avatar EpicWink commented on May 26, 2024

from oasdiff.

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.