Comments (14)
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.
The latest release adds support for color=auto|always|never
Your feedback is welcome.
from oasdiff.
CI usually does not have stdout be a TTY, so my proposal would default to no colours in that case
from oasdiff.
@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.
I still think the flag is valuable. We can pipe out to a json file in the meantime.
from oasdiff.
Hi @JSSAggie,
#386 will remove color codes from json and yaml output.
Does this address your requirement?
from oasdiff.
Looks like that will do it. Thanks
from oasdiff.
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.
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.
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.
We will add --color=[auto|always|never]
Thanks for your input!
from oasdiff.
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.
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.
from oasdiff.
Related Issues (20)
- `response-property-became-required` is added for required properties that are newly added to response bodies HOT 1
- Non-friendly error message
- oasdiff flatten doesn't output paths HOT 1
- YAML/JSON field name typo: "reuired" -> "required" HOT 1
- Feature request: Support external metadata
- Verbose CLI output to help troubleshoot (especially in composed mode) HOT 5
- oasdiff error in composed mode when the same path appears in different files HOT 1
- Race condition while parsing command line arguments if telemetry is enabled HOT 1
- "Error resolving reference/map key not found" when running oasdiff across the set of files with intensive external refs HOT 1
- Supporting "--fail-on" option for changelog command
- basePath and servers.ulr support HOT 3
- Add support for AWS API Gateway extensions to OpenAPI HOT 6
- Diff tool gets confused when a new inline enum value is added and a new enum type is added at the sime time HOT 4
- Changelog does not log adding a new optional request body HOT 2
- `latest` docker container (April 8th) introduces a bug that causes false positives HOT 1
- --flatten-allof panic HOT 3
- Unmarshalling errors don't provide offset HOT 6
- Support breaking-changes and changelog for schemas with multiple types
- Support "flatten allOf" for schemas with multiple types
- Typo in description of incompatible changes HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oasdiff.