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

fmt: Make default_max_depth configurable #12310

Merged
merged 1 commit into from
Feb 1, 2023
Merged

Conversation

ominitay
Copy link
Contributor

@ominitay ominitay commented Jul 31, 2022

There is currently no way to override this when using std.fmt.fmt(), and derived functions (anything.print(), std.log, etc). This small change allows overriding the default value. In future, there should likely be a specifier in the fmt string. That is probably best to be discussed in #1358, or an offshoot issue.

Closes #2370

@squeek502
Copy link
Collaborator

squeek502 commented Jul 31, 2022

Closes, or at least contributes towards #2370

EDIT: Also might be worth reading this closed PR: #5412

@ominitay
Copy link
Contributor Author

Would like to see what @andrewrk thinks about this, considering the closed PR, and that there seems to have been no further discussion since.

@Vexu
Copy link
Member

Vexu commented Aug 1, 2022

#1358 looks like it is mostly implemented already, maybe we should discuss how this could be integrated into the argument system in #2370 before adding what looks like a workaround.

@ominitay
Copy link
Contributor Author

ominitay commented Aug 1, 2022

I don't feel that this is a workaround. The default should be configurable IMO, and should be able to be overridden on a case-by-case basis.

@ominitay
Copy link
Contributor Author

ominitay commented Aug 1, 2022

Anyway, I'd like to hear Andrew's thoughts on this, considering he had some plan in mind.

Copy link
Member

@Vexu Vexu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be updated to use std.options.

@ominitay
Copy link
Contributor Author

Will get that done soon :)

@ominitay
Copy link
Contributor Author

Haven't been programming for a while, so please give my changes a little scrutiny ;)

@Vexu Vexu merged commit 3c8d968 into ziglang:master Feb 1, 2023
@ominitay ominitay deleted the fmt-depth branch February 4, 2023 00:21
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

Successfully merging this pull request may close these issues.

std.fmt: Make max_depth configurable
3 participants