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

cmd/go: align comments in go.mod files #28513

Open
jerome-laforge opened this Issue Oct 31, 2018 · 4 comments

Comments

Projects
None yet
5 participants
@jerome-laforge
Copy link

jerome-laforge commented Oct 31, 2018

Please answer these questions before submitting your issue. Thanks!

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

Go 1.11

Does this issue reproduce with the latest release?

yes

What did you do?

go mod init
go mod tidy

What did you expect to see?

Into go.mod, is it possible to have (like into comment into source code) align of // indirect

module myModule

require (
	github.com/something v1.0.0
	github.com/foo v1.0.0       // indirect
	github.com/foo/bar v1.0.0   // indirect	
)

What did you see instead?

module myModule

require (
	github.com/something v1.0.0
	github.com/foo v1.0.0  // indirect
	github.com/foo/bar v1.0.0 // indirect	
)

@katiehockman katiehockman changed the title go.mod: Align // indirect as coment into source code cmd/go: Align // indirect as coment into source code Oct 31, 2018

@katiehockman katiehockman added this to the Unplanned milestone Oct 31, 2018

@mvdan mvdan added the NeedsDecision label Oct 31, 2018

@mvdan

This comment has been minimized.

Copy link
Member

mvdan commented Oct 31, 2018

/cc @bcmills @rsc to see if we actually want to do this.

@rogpeppe

This comment has been minimized.

Copy link
Contributor

rogpeppe commented Oct 31, 2018

Personally, I'm not a big fan of alignment like that. it messes up diffs - what would be a single-line addition or removal of a dependency becomes a change to every line with a // indirect comment on.

Also, hopefully, we'll see many less // indirect comments as time goes on and more and more repositories get go.mod files, so this will become less of an issue over time.

@jerome-laforge

This comment has been minimized.

Copy link
Author

jerome-laforge commented Oct 31, 2018

Also, hopefully, we'll see many less // indirect comments as time goes on and more and more repositories get go.mod files, so this will become less of an issue over time.

It is appear to be acceptable.
Thx

@bcmills

This comment has been minimized.

Copy link
Member

bcmills commented Jan 17, 2019

As @rogpeppe notes, // indirect requirements should decrease over time.

(It's true that alignment add spurious diffs, but arguably diff -b — a.k.a. diff --ignore-space-change is a good default for Go development anyway, given gofmt.)

@bcmills bcmills changed the title cmd/go: Align // indirect as coment into source code cmd/go: align comments in go.mod files Jan 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.