]> Cypherpunks.ru repositories - gostls13.git/commitdiff
all: fix TODO comment hanging indents
authorRuss Cox <rsc@golang.org>
Mon, 31 Jan 2022 00:22:46 +0000 (19:22 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 1 Apr 2022 18:18:05 +0000 (18:18 +0000)
For whatever reason (perhaps some tool does this), a handful of comments,
including some doc comments, have TODOs formatted like:

// TODO(name): Text here and
//             more text aligned
//             under first text.

In doc comments the second line turns into a <pre> block,
which is undesirable in this context.

Rewrite those to unindent, like this instead:

// TODO(name): Text here and
// more text aligned
// at left column.

For #51082.

Change-Id: Ibf5145659a61ebf9496f016752a709a7656d2d4b
Reviewed-on: https://go-review.googlesource.com/c/go/+/384258
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>

24 files changed:
src/cmd/compile/internal/ssa/func_test.go
src/cmd/compile/internal/syntax/nodes.go
src/cmd/compile/internal/syntax/pos.go
src/cmd/compile/internal/syntax/tokens.go
src/cmd/compile/internal/syntax/walk.go
src/cmd/compile/internal/types2/assignments.go
src/cmd/compile/internal/types2/lookup.go
src/cmd/compile/internal/types2/named.go
src/cmd/compile/internal/types2/return.go
src/cmd/compile/internal/types2/stmt.go
src/cmd/compile/internal/types2/validtype.go
src/go/ast/walk.go
src/go/constant/value.go
src/go/parser/performance_test.go
src/go/printer/nodes.go
src/go/printer/testdata/parser.go
src/go/types/lookup.go
src/go/types/named.go
src/go/types/return.go
src/go/types/stmt.go
src/go/types/validtype.go
src/math/big/arith_test.go
src/net/http/transport_test.go
src/reflect/type.go

index 276c444b9a88f01a3eeff5824c3550ebe205af03..bbb228d8a5fed61bc97f6d95a787762ce88eef30 100644 (file)
@@ -34,7 +34,7 @@ package ssa
 
 // TODO(matloob): Choose better names for Fun, Bloc, Goto, etc.
 // TODO(matloob): Write a parser for the Func disassembly. Maybe
-//                the parser can be used instead of Fun.
+// the parser can be used instead of Fun.
 
 import (
        "cmd/compile/internal/types"
index 2f9b43edef98ad42edd4ad01e676fff5d83c26e0..b0a0918e77b8a7270250e26ecf8d1c781d3c4873 100644 (file)
@@ -462,7 +462,7 @@ func (simpleStmt) aSimpleStmt() {}
 // Comments
 
 // TODO(gri) Consider renaming to CommentPos, CommentPlacement, etc.
-//           Kind = Above doesn't make much sense.
+// Kind = Above doesn't make much sense.
 type CommentKind uint
 
 const (
index 1494c0989fb11a1258649f6f0e45c39f7e147747..b5e53d268bd247d51190cb07d46a4f4220dab685 100644 (file)
@@ -24,7 +24,7 @@ type Pos struct {
 func MakePos(base *PosBase, line, col uint) Pos { return Pos{base, sat32(line), sat32(col)} }
 
 // TODO(gri) IsKnown makes an assumption about linebase < 1.
-//           Maybe we should check for Base() != nil instead.
+// Maybe we should check for Base() != nil instead.
 
 func (pos Pos) Pos() Pos       { return pos }
 func (pos Pos) IsKnown() bool  { return pos.line > 0 }
index 60eae36ec924919266557be0c5156aba6dcc5204..6dece1aa5bacbfe80af0c8f465ada3f89b963612 100644 (file)
@@ -93,8 +93,8 @@ func contains(tokset uint64, tok token) bool {
 type LitKind uint8
 
 // TODO(gri) With the 'i' (imaginary) suffix now permitted on integer
-//           and floating-point numbers, having a single ImagLit does
-//           not represent the literal kind well anymore. Remove it?
+// and floating-point numbers, having a single ImagLit does
+// not represent the literal kind well anymore. Remove it?
 const (
        IntLit LitKind = iota
        FloatLit
index b02584420488442a3e284d5b611fa025001bd59e..8f1d566155d2328021966a19def18658f5e07ec3 100644 (file)
@@ -52,7 +52,7 @@ func Crawl(root Node, f func(Node) bool) {
 // field lists such as type T in "a, b, c T"). Such shared nodes are
 // walked multiple times.
 // TODO(gri) Revisit this design. It may make sense to walk those nodes
-//           only once. A place where this matters is types2.TestResolveIdents.
+// only once. A place where this matters is types2.TestResolveIdents.
 func Walk(root Node, v Visitor) {
        walker{v}.node(root)
 }
index 49f4e2d2ab590fceeb668f45e36de384fcb6414b..f766c0b31d6b396de4e1860399c1ae0d4ceaa624 100644 (file)
@@ -441,8 +441,8 @@ func (check *Checker) assignVars(lhs, orig_rhs []syntax.Expr) {
 // unpack unpacks a *syntax.ListExpr into a list of syntax.Expr.
 // Helper introduced for the go/types -> types2 port.
 // TODO(gri) Should find a more efficient solution that doesn't
-//           require introduction of a new slice for simple
-//           expressions.
+// require introduction of a new slice for simple
+// expressions.
 func unpackExpr(x syntax.Expr) []syntax.Expr {
        if x, _ := x.(*syntax.ListExpr); x != nil {
                return x.ElemList
index 08328772260fc308ec804e367fb51dcc525a04ea..335e4d0c2326a20bcce03341a7906fafef9e9310 100644 (file)
@@ -83,9 +83,9 @@ func LookupFieldOrMethod(T Type, addressable bool, pkg *Package, name string) (o
 }
 
 // TODO(gri) The named type consolidation and seen maps below must be
-//           indexed by unique keys for a given type. Verify that named
-//           types always have only one representation (even when imported
-//           indirectly via different packages.)
+// indexed by unique keys for a given type. Verify that named
+// types always have only one representation (even when imported
+// indirectly via different packages.)
 
 // lookupFieldOrMethod should only be called by LookupFieldOrMethod and missingMethod.
 // If foldCase is true, the lookup for methods will include looking for any method
index 584ee51a136ab121ed03669437e0673ff6a28e3f..1d3703ffd91aa172f6f77810be66397dac54cf51 100644 (file)
@@ -107,7 +107,7 @@ func (t *Named) Obj() *TypeName { return t.orig.obj } // for non-instances this
 func (t *Named) Origin() *Named { return t.orig }
 
 // TODO(gri) Come up with a better representation and API to distinguish
-//           between parameterized instantiated and non-instantiated types.
+// between parameterized instantiated and non-instantiated types.
 
 // TypeParams returns the type parameters of the named type t, or nil.
 // The result is non-nil for an (originally) generic type even if it is instantiated.
index 6c3e1842ce7d715b93d350ff58cc1e3738e4cf0d..7cdea99e0865ac83cf50518985fb8f9a601385f0 100644 (file)
@@ -99,8 +99,8 @@ func (check *Checker) isTerminatingSwitch(body []*syntax.CaseClause, label strin
 }
 
 // TODO(gri) For nested breakable statements, the current implementation of hasBreak
-//          will traverse the same subtree repeatedly, once for each label. Replace
-//           with a single-pass label/break matching phase.
+// will traverse the same subtree repeatedly, once for each label. Replace
+// with a single-pass label/break matching phase.
 
 // hasBreak reports if s is or contains a break statement
 // referring to the label-ed statement or implicit-ly the
index 2b6abbde7e2224c0663f81392001ff878371fd5a..e00f73ce99719fe13a6054246b1fbf646a8693fc 100644 (file)
@@ -312,7 +312,7 @@ L:
 }
 
 // TODO(gri) Once we are certain that typeHash is correct in all situations, use this version of caseTypes instead.
-//           (Currently it may be possible that different types have identical names and import paths due to ImporterFrom.)
+// (Currently it may be possible that different types have identical names and import paths due to ImporterFrom.)
 //
 // func (check *Checker) caseTypes(x *operand, xtyp *Interface, types []syntax.Expr, seen map[string]syntax.Expr) (T Type) {
 //     var dummy operand
index c7d42551dd46dd014d4cd6285f0cab3930daf883..d495c6788ee0722495467e3c53b55dc12b155b5b 100644 (file)
@@ -141,8 +141,8 @@ func (env *tparamEnv) push(typ *Named) *tparamEnv {
 }
 
 // TODO(gri) Alternative implementation:
-//           We may not need to build a stack of environments to
-//           look up the type arguments for type parameters. The
-//           same information should be available via the path:
-//           We should be able to just walk the path backwards
-//           and find the type arguments in the instance objects.
+// We may not need to build a stack of environments to
+// look up the type arguments for type parameters. The
+// same information should be available via the path:
+// We should be able to just walk the path backwards
+// and find the type arguments in the instance objects.
index 308662f633b50cec49ec14e355f98c4aa24bbded..16b15f11f2f8c715fde5d800c433adb7cf5b0f0d 100644 (file)
@@ -40,7 +40,7 @@ func walkDeclList(v Visitor, list []Decl) {
 }
 
 // TODO(gri): Investigate if providing a closure to Walk leads to
-//            simpler use (and may help eliminate Inspect in turn).
+// simpler use (and may help eliminate Inspect in turn).
 
 // Walk traverses an AST in depth-first order: It starts by calling
 // v.Visit(node); node must not be nil. If the visitor w returned by
index dee3bce9eef412beda43ba232db4aa2261138953..544801bd70caae94c6dc4a7f8ecdaf71bc8af6d3 100644 (file)
@@ -70,9 +70,9 @@ type Value interface {
 const prec = 512
 
 // TODO(gri) Consider storing "error" information in an unknownVal so clients
-//           can provide better error messages. For instance, if a number is
-//           too large (incl. infinity), that could be recorded in unknownVal.
-//           See also #20583 and #42695 for use cases.
+// can provide better error messages. For instance, if a number is
+// too large (incl. infinity), that could be recorded in unknownVal.
+// See also #20583 and #42695 for use cases.
 
 // Representation of values:
 //
index 6f8a97770bc143aa74ccd2e06be19e92562e7ffa..1249f35d39da186efd7367c04801b7f68d90b731 100644 (file)
@@ -10,8 +10,8 @@ import (
        "testing"
 )
 
-// TODO(rFindley): use a testdata file or file from another package here, to
-//                 avoid a moving target.
+// TODO(rfindley): use a testdata file or file from another package here, to
+// avoid a moving target.
 var src = readFile("parser.go")
 
 func readFile(filename string) []byte {
index 9a09d58eb2c8d6ce2a1e7bc0c2b38015f9ea37fa..89e8016409c826bd6acbbff6b0d1d0af2a39f013 100644 (file)
@@ -38,12 +38,12 @@ import (
 // printed.
 //
 // TODO(gri): linebreak may add too many lines if the next statement at "line"
-//            is preceded by comments because the computation of n assumes
-//            the current position before the comment and the target position
-//            after the comment. Thus, after interspersing such comments, the
-//            space taken up by them is not considered to reduce the number of
-//            linebreaks. At the moment there is no easy way to know about
-//            future (not yet interspersed) comments in this function.
+// is preceded by comments because the computation of n assumes
+// the current position before the comment and the target position
+// after the comment. Thus, after interspersing such comments, the
+// space taken up by them is not considered to reduce the number of
+// linebreaks. At the moment there is no easy way to know about
+// future (not yet interspersed) comments in this function.
 //
 func (p *printer) linebreak(line, min int, ws whiteSpace, newSection bool) (nbreaks int) {
        n := nlimit(line - p.pos.Line)
@@ -125,7 +125,7 @@ const filteredMsg = "contains filtered or unexported fields"
 // expressions.
 //
 // TODO(gri) Consider rewriting this to be independent of []ast.Expr
-//           so that we can use the algorithm for any kind of list
+// so that we can use the algorithm for any kind of list
 //           (e.g., pass list via a channel over which to range).
 func (p *printer) exprList(prev0 token.Pos, list []ast.Expr, depth int, mode exprListMode, next0 token.Pos, isIncomplete bool) {
        if len(list) == 0 {
index 7e8379739c6dc88469fff323bfe095d6b14ba7bd..615aceebd21485da4baaabc6df8e7a611c925f5a 100644 (file)
@@ -1352,7 +1352,7 @@ func (p *parser) parseBinaryExpr(lhs bool, prec1 int) ast.Expr {
 
 // If lhs is set and the result is an identifier, it is not resolved.
 // TODO(gri): parseExpr may return a type or even a raw type ([..]int) -
-//            should reject when a type/raw type is obviously not allowed
+// should reject when a type/raw type is obviously not allowed
 func (p *parser) parseExpr(lhs bool) ast.Expr {
        if p.trace {
                defer un(trace(p, "Expression"))
index 335fada7b764957cdf310177b2adaca082e902dc..77fc17f5c357d30f032c960cce73858698c8bff4 100644 (file)
@@ -83,9 +83,9 @@ func LookupFieldOrMethod(T Type, addressable bool, pkg *Package, name string) (o
 }
 
 // TODO(gri) The named type consolidation and seen maps below must be
-//           indexed by unique keys for a given type. Verify that named
-//           types always have only one representation (even when imported
-//           indirectly via different packages.)
+// indexed by unique keys for a given type. Verify that named
+// types always have only one representation (even when imported
+// indirectly via different packages.)
 
 // lookupFieldOrMethod should only be called by LookupFieldOrMethod and missingMethod.
 // If foldCase is true, the lookup for methods will include looking for any method
index e4fd96ab646f391672daac3f2a128c62cbf2a7a8..ee3508014220f6666eed969d2c789b035b765ea3 100644 (file)
@@ -109,7 +109,7 @@ func (t *Named) Obj() *TypeName {
 func (t *Named) Origin() *Named { return t.orig }
 
 // TODO(gri) Come up with a better representation and API to distinguish
-//           between parameterized instantiated and non-instantiated types.
+// between parameterized instantiated and non-instantiated types.
 
 // TypeParams returns the type parameters of the named type t, or nil.
 // The result is non-nil for an (originally) generic type even if it is instantiated.
index 2d34a70b98ba6bf429ee71c413b444deae14049e..ee8c41a431d8568657d94b72cb2bde13f6fc61b1 100644 (file)
@@ -101,8 +101,8 @@ func (check *Checker) isTerminatingSwitch(body *ast.BlockStmt, label string) boo
 }
 
 // TODO(gri) For nested breakable statements, the current implementation of hasBreak
-//          will traverse the same subtree repeatedly, once for each label. Replace
-//           with a single-pass label/break matching phase.
+// will traverse the same subtree repeatedly, once for each label. Replace
+// with a single-pass label/break matching phase.
 
 // hasBreak reports if s is or contains a break statement
 // referring to the label-ed statement or implicit-ly the
index d7f6a486ca95371512d56dca8b0400145dc2aca0..0fab70719ec21efb2bd8545647aaf0357cf9a4cd 100644 (file)
@@ -317,7 +317,7 @@ L:
 }
 
 // TODO(gri) Once we are certain that typeHash is correct in all situations, use this version of caseTypes instead.
-//           (Currently it may be possible that different types have identical names and import paths due to ImporterFrom.)
+// (Currently it may be possible that different types have identical names and import paths due to ImporterFrom.)
 //
 // func (check *Checker) caseTypes(x *operand, xtyp *Interface, types []ast.Expr, seen map[string]ast.Expr) (T Type) {
 //     var dummy operand
index 2c686f265506e48bd90d236d5ee31937618bdf8b..edb4c02ecdacd86408c2c41075dceb4d90e09c56 100644 (file)
@@ -140,8 +140,8 @@ func (env *tparamEnv) push(typ *Named) *tparamEnv {
 }
 
 // TODO(gri) Alternative implementation:
-//           We may not need to build a stack of environments to
-//           look up the type arguments for type parameters. The
-//           same information should be available via the path:
-//           We should be able to just walk the path backwards
-//           and find the type arguments in the instance objects.
+// We may not need to build a stack of environments to
+// look up the type arguments for type parameters. The
+// same information should be available via the path:
+// We should be able to just walk the path backwards
+// and find the type arguments in the instance objects.
index 7b3427f83415ba49d8350e4e835781577269be07..789b96bf35c189801ec46b6a6a11f2997ae73ed1 100644 (file)
@@ -510,7 +510,7 @@ func testFunVWW(t *testing.T, msg string, f funVWW, a argVWW) {
 }
 
 // TODO(gri) mulAddVWW and divWVW are symmetric operations but
-//           their signature is not symmetric. Try to unify.
+// their signature is not symmetric. Try to unify.
 
 type funWVW func(z []Word, xn Word, x []Word, y Word) (r Word)
 type argWVW struct {
index e5d60afb1bb51f0e3ba4a9d00f82759ec12eab23..440d6b969b08aa9d0603df8243194bc305835c02 100644 (file)
@@ -48,7 +48,7 @@ import (
 )
 
 // TODO: test 5 pipelined requests with responses: 1) OK, 2) OK, Connection: Close
-//       and then verify that the final 2 responses get errors back.
+// and then verify that the final 2 responses get errors back.
 
 // hostPortHandler writes back the client's "host:port".
 var hostPortHandler = HandlerFunc(func(w ResponseWriter, r *Request) {
index 83047062bdb97c1566235609e2a06e95b5aa9de5..9589e83dbdf49b76710609637af2e44fd43d8d91 100644 (file)
@@ -1267,7 +1267,7 @@ func (t *structType) Field(i int) (f StructField) {
 }
 
 // TODO(gri): Should there be an error/bool indicator if the index
-//            is wrong for FieldByIndex?
+// is wrong for FieldByIndex?
 
 // FieldByIndex returns the nested field corresponding to index.
 func (t *structType) FieldByIndex(index []int) (f StructField) {