Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(429)

Issue 163068: code review 163068: Add flag -tabindent to gofmt: forces use of (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 4 months ago by gri
Modified:
15 years, 4 months ago
Reviewers:
rsc
Visibility:
Public.

Description

Add flag -tabindent to gofmt: forces use of tabs for indentation even if -spaces is set. Changes to gofmt: - added -tabindent flag - don't recompute parser and printer mode repeatedly Changes to go/printer: - provide new printing mode TabIndent Changes to tabwriter: - implement new mode TabIndent to use tabs independent of the actual padding character for leading empty columns - distinguish between minimal cell width and tab width (tabwidth is only used if the output contains tabs, minwidth and padding are always considered) - fixed and added more comments - some additional factoring By default, -tabindent is disabled and the default gofmt behavior is unchanged. By setting -spaces and -tabindent, gofmt will use tabs for indentation but do any other alignment with spaces. This permits a user to change the visible indentation by simply changing the editor's tab width and the code will remain properly aligned without the need to rerun gofmt.

Patch Set 1 #

Patch Set 2 : code review 163068: Add flag -tabindent to gofmt: forces use of #

Patch Set 3 : code review 163068: Add flag -tabindent to gofmt: forces use of #

Patch Set 4 : code review 163068: Add flag -tabindent to gofmt: forces use of #

Patch Set 5 : code review 163068: Add flag -tabindent to gofmt: forces use of #

Unified diffs Side-by-side diffs Delta from patch set Stats (+196 lines, -159 lines) Patch
M src/cmd/gofmt/gofmt.go View 1 2 3 4 5 chunks +21 lines, -13 lines 0 comments Download
M src/pkg/go/printer/printer.go View 1 2 3 2 chunks +11 lines, -2 lines 0 comments Download
M src/pkg/tabwriter/tabwriter.go View 1 12 chunks +107 lines, -87 lines 0 comments Download
M src/pkg/tabwriter/tabwriter_test.go View 1 2 3 4 20 chunks +57 lines, -57 lines 0 comments Download

Messages

Total messages: 5
gri
Hello rsc, I'd like you to review the following change.
15 years, 4 months ago (2009-12-02 04:57:08 UTC) #1
rsc
LGTM This is going to be painful to roll out.
15 years, 4 months ago (2009-12-03 00:51:45 UTC) #2
gri
*** Submitted as http://code.google.com/p/go/source/detail?r=17d3ac883eb2 *** Add flag -tabindent to gofmt: forces use of tabs for ...
15 years, 4 months ago (2009-12-03 00:57:17 UTC) #3
gri
I am suggesting that we don't change the default quite yet. There may be some ...
15 years, 4 months ago (2009-12-03 00:58:51 UTC) #4
rsc
15 years, 4 months ago (2009-12-03 01:05:29 UTC) #5
On Wed, Dec 2, 2009 at 16:58, Robert Griesemer <gri@golang.org> wrote:
> I am suggesting that we don't change the default quite yet. There may
> be some fine-tuning, and if we change the semicolon handling we should
> combine the two. In the meantime, godoc can use the new mode.

good plan
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b