Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add YAML support to server#6934

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ammario merged 42 commits intomainfromyaml
Apr 7, 2023
Merged

feat: add YAML support to server#6934

ammario merged 42 commits intomainfromyaml
Apr 7, 2023

Conversation

ammario
Copy link
Member

@ammarioammario commentedMar 31, 2023
edited
Loading

This re-releases support links, amongst other benefits to operability.

  • Update cli docs generator to include YAML in table

Follow-up:

  • Restore supportLinks docs
  • Write docs on YAML
  • Convert OptionSet to[]*Option to avoid all the complex indirection seen in this PR

@ammarioammario requested a review frommafredriApril 6, 2023 23:27
@ammario
Copy link
MemberAuthor

ammario commentedApr 6, 2023
edited
Loading

@mafredri — this is probably 1k lines excluding generated code. I've manually tested that it works, but I'll write YAML docs and restore the support links docs in a separate PR with@bpmct to review.

I also agree with making OptionSet a[]*Option, which I'll do separately.

Edit: untagged you since you're on PTO.

@ammarioammario removed the request for review frommafredriApril 7, 2023 16:05
Comment on lines 68 to 75
comment:=wordwrap.WrapString(
fmt.Sprintf("%s (default: %s, type: %s)",opt.Description,defValue,opt.Value.Type()),
80,
)
nameNode:= yaml.Node{
Kind:yaml.ScalarNode,
Value:opt.YAML,
HeadComment:wordwrap.WrapString(opt.Description,80),
HeadComment:wordwrap.WrapString(comment,80),
Copy link
Contributor

Choose a reason for hiding this comment

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

comment seems to be wordwrap'd twice

defValue="<unset>"
}
comment:=wordwrap.WrapString(
fmt.Sprintf("%s (default: %s, type: %s)",opt.Description,defValue,opt.Value.Type()),
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this would be nicer to read as%s\n(default: %s, type: %s) so default is always on the last line. Looking at the golden file it was hard to parse when the default/type randomly wrapped at 80 chars.

Copy link
Contributor

Choose a reason for hiding this comment

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

Big fan of including the description as a comment, and the word wrapping makes it easy to read.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Good catch

# An HTTP URL that is accessible by other replicas to relay DERP traffic. Required
# for high availability.
# (default: <unset>, type: url)
relayURL:
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like url types are the only fields that are printed out empty when the default is unset, the others seem to use the zero value.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe the type would be better asstring(url) so that it's clear you're inputting a string here? Unsure though.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I think for the most part it's self-explanatory.

@ammarioammarioenabled auto-merge (squash)April 7, 2023 22:58
@ammarioammario merged commit4b99e2d intomainApr 7, 2023
@ammarioammario deleted the yaml branchApril 7, 2023 22:58
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsApr 7, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

1 more reviewer

@coadlercoadlercoadler approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

@ammarioammario

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@ammario@coadler

[8]ページ先頭

©2009-2025 Movatter.jp