question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add --format flag to Zally CLI

See original GitHub issue

In order to make Zally Command Line Utility (CLI) usable in different Continuous Integration platforms, we want to add more formatting options. Therefore, we need to implement an extra --format flag.

Acceptance Criteria

As a Zally CLI user
I want to provide the --format flag when running CLI
So that Zally will format its output in plain text or markdown

Example

./zally --format=markdown

Expected text output:

MUST Use Problem JSON
  Operations Should Return Problem JSON When Any Problem Occurs During Processing Whether Caused by Client Or Server
  https://zalando.github.io/restful-api-guidelines/#176
    /products GET 429
    /products/{product_id} GET 418
    /products/{product_id} GET 429
    /products/{product_id} PATCH 400
    /products/{product_id} PATCH 429

Expected markdown output

### `MUST` [Use Problem JSON](https://zalando.github.io/restful-api-guidelines/#176)

> Operations Should Return Problem JSON When Any Problem Occurs During Processing Whether Caused by Client Or Server
        
- /products GET 429
- /products/{product_id} GET 418
- /products/{product_id} GET 429
- /products/{product_id} PATCH 400
- /products/{product_id} PATCH 429

Expected output when no violations happened:

Congratulations! No violations found.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
netmecommented, Feb 28, 2018

Thanks @maxim-tschumak and @roxspring for the valuable input. Let me proceed with the implementation then

1reaction
maxim-tschumakcommented, Feb 27, 2018

Looks good!

Should we also distinguish between text output with colors and without colors?

Let’s keep it simple 😃

Should “no violation” differ in markdown / text outputs?

IMHO, it can be the same

How about Short / Long / Custom formats for every single violation (example: git log --pretty)

Great idea!

Read more comments on GitHub >

github_iconTop Results From Across the Web

zalando/zally - Gitter
Hi Zally team, we are an OpenAPI team from Finastra. We are successfully running the full Zalando-Zally stack on both Windows and Linux...
Read more >
zally | A minimalistic, simple-to-use API linter
Zally's easy-to-use CLI uses the server in the background so that you can check ... Swagger-friendly: accepts Swagger .yaml and JSON formats; includes...
Read more >
Teleport CLI Reference | Teleport Docs
These flags are available for all commands --login, --proxy, --user, --ttl, --identity, --cert-format, --insecure, --auth, --skip-version, --debug, --jumphost .
Read more >
CLI Flags in Practice + How to Make Your Own CLI Command ...
The syntax of CLI commands plus how to create your own CLI with oclif. ... These two formats for flags are the standard...
Read more >
podman-run
podman save --format docker-dir fedora -o /tmp/fedora $ podman run ... Use the --group-add keep-groups flag to pass the user's supplementary group access ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found