Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to have recordings indented by 2 spaces #1599

Closed
KodiVerse opened this issue Jun 28, 2019 · 7 comments
Closed

Add an option to have recordings indented by 2 spaces #1599

KodiVerse opened this issue Jun 28, 2019 · 7 comments

Comments

@KodiVerse
Copy link
Contributor

We would like to add an option to:

outputs = JSON.stringify(outputs, null, 4)

This will allow us to support specifying the indentation in our recordings.

We would be willing to do a pull request.
Suggestions for option name "indent" or "recordingIndent"?

@simlu
Copy link

simlu commented Jul 23, 2019

@paulmelnikow @mastermatt We would really like to implement this. Any advice you can give before we get started?

@mastermatt
Copy link
Member

Just to throw an idea out: What if that JSON.stringify line was updated to only be called if output wasn't already a string? Then the expectation would be that users could define a afterRecord hook if they wanted to deviated from the out of the box option.
Or.. we could implement both.

@simlu as for advice on implementing the option; the options arg passed to Back is already made available in the finish function. It should be as basic as looking for a specific key in that object.
Things to keep in mind, the space arg of stringify can be a number, string, or null.

@simlu
Copy link

simlu commented Jul 25, 2019

I actually like option one as it would give much more flexibility e.g. use https://github.com/lydell/json-stringify-pretty-compact

KodiVerse added a commit to KodiVerse/nock that referenced this issue Jul 29, 2019
KodiVerse added a commit to KodiVerse/nock that referenced this issue Jul 29, 2019
KodiVerse added a commit to KodiVerse/nock that referenced this issue Jul 29, 2019
KodiVerse added a commit to KodiVerse/nock that referenced this issue Jul 29, 2019
KodiVerse added a commit to KodiVerse/nock that referenced this issue Aug 8, 2019
@paulmelnikow
Copy link
Member

Was this solved in #1649?

@simlu
Copy link

simlu commented Aug 16, 2019

@paulmelnikow Yes, once that is merged in we should be g2g. Thank you!

paulmelnikow pushed a commit that referenced this issue Aug 20, 2019
…1682)

* ci(travis): run release stage on [Version].x, next, beta branches

* ci(package): update semantic-release to beta.13

* feat: `afterRecord` support for custom formatting after recording.

#1599
@simlu
Copy link

simlu commented Aug 20, 2019

Thank you very much. We've already made use of this new feature here

🎉

@paulmelnikow
Copy link
Member

Thanks for your work on it!

gr2m pushed a commit that referenced this issue Sep 4, 2019
…1682)

* ci(travis): run release stage on [Version].x, next, beta branches

* ci(package): update semantic-release to beta.13

* feat: `afterRecord` support for custom formatting after recording.

#1599
gr2m pushed a commit that referenced this issue Sep 4, 2019
…1682)

* ci(travis): run release stage on [Version].x, next, beta branches

* ci(package): update semantic-release to beta.13

* feat: `afterRecord` support for custom formatting after recording.

#1599
gr2m pushed a commit that referenced this issue Sep 5, 2019
…1682)

* ci(travis): run release stage on [Version].x, next, beta branches

* ci(package): update semantic-release to beta.13

* feat: `afterRecord` support for custom formatting after recording.

#1599
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants