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

go/doc/comment: list inside comment that start and end with "/* */" does not formatted #52539

Closed
shuLhan opened this issue Apr 25, 2022 · 3 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Milestone

Comments

@shuLhan
Copy link
Contributor

shuLhan commented Apr 25, 2022

Following #51082, I think there is a bug with list formatting when comment start and end with /*...*/ in the current tip branch, or maybe a missing exception in the proposal since the spec still allow comment start/end with /*...*/.

What version of Go are you using (go version)?

The latest tip from playground.

Does this issue reproduce with the latest release?

No, only tip.

What did you do?

See https://go.dev/play/p/WfIdp2WQphD?v=gotip

What did you expect to see?

The list on the comment section reformated, as below

/*
testCommentSlashStart method with header and list

# Header

Here is the list,

  - a
  - b
*/

What did you see instead?

/*
testCommentSlashStart method with header and list

# Header

Here is the list,

* a
* b
*/
func testCommentSlashStart() {}
@shuLhan shuLhan changed the title gofmt: comment start and end with " gofmt: list inside comment that start and end with "/* */" does not formatted Apr 25, 2022
@thanm thanm added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 25, 2022
@thanm
Copy link
Contributor

thanm commented Apr 25, 2022

@rsc

@ianlancetaylor ianlancetaylor changed the title gofmt: list inside comment that start and end with "/* */" does not formatted go/doc/comment: list inside comment that start and end with "/* */" does not formatted Apr 26, 2022
@ianlancetaylor ianlancetaylor added this to the Go1.19 milestone Apr 26, 2022
@heschi
Copy link
Contributor

heschi commented May 11, 2022

ping: this is a release blocker that hasn't been updated in a while.

@ianlancetaylor
Copy link
Contributor

According to the rules at https://github.com/golang/proposal/blob/master/design/51082-godocfmt.md, a list is only recognized as a series of indented lines. In this example, the list items are not indented. Closing because this is working as expected. Please comment if you disagree.

@golang golang locked and limited conversation to collaborators May 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Projects
None yet
Development

No branches or pull requests

5 participants