Tidb: correct comments mistake in all packages

Created on 23 Apr 2017  Â·  24Comments  Â·  Source: pingcap/tidb

  • [x] ddl
  • [x] executor
  • [x] expression
  • [ ] inspectkv
  • [x] model
  • [x] privilege
  • [x] statistics
  • [ ] terror
  • [ ] kv
  • [x] mysql
  • [x] server
  • [ ] store
  • [ ] tidb-server
  • [ ] ast
  • [ ] parser
  • [ ] structure
  • [x] cmd
  • [x] domain
  • [x] meta
  • [x] perfschema
  • [x] table
  • [ ] context
  • [x] executor
  • [x] infoschema
  • [ ] plan
  • [x] sessionctx
  • [x] tablecodec
  • [x] util
  • [x] bootstrap
    the workflow is the following,
    ~
    $ cd tidb
    $ cd ddl //ddl is just a package in tidb, you need change to another one.
    $ goword $(find . -name '*.go' | grep -v -e #"^./_vendor")
    ~

    Based on the error info, you can improve the original comments.

If you did not install goword, just make goword. Please register your PR in this issue and ping me to update todo list.

good-first-issue statuhelp-wanted

Most helpful comment

@zhexuany @gaocegege @yuanwhy
Thank you for all your help.
I want to share some tips when you find adding comments for a function is not straightforward.

There may be some functions that you don't fully understand what it does, literally explain the function name may be misleading. In this case, we can add comment like this:

// abcFunc ...
fucn abcFuc () {
    doSomething()
}

All 24 comments

@coocood Please label this as help-wanted and for new-contributor

dibs expression :)

expression is done #3123

@zhexuany @gaocegege @yuanwhy
Thank you for all your help.
I want to share some tips when you find adding comments for a function is not straightforward.

There may be some functions that you don't fully understand what it does, literally explain the function name may be misleading. In this case, we can add comment like this:

// abcFunc ...
fucn abcFuc () {
    doSomething()
}

perfschema is done #3186

@zhexuany infoschema is done: #3239

privilege is done: #3250

expression is done: #3272

statistics is done: #4711

Ping @zhexuany for updating the task status.

@ladrift Thanks. Just updated.

kv is done: #6829

Ping @zhexuany mysql and server are done: #7661

Ping @zhexuany expression package still has comments mistake error.

➜  expression git:(qi_json) ✗ git commit -am "don't konw how to do... "
Checking for files that need gofmt... OK

Checking for files that need goword... ERROR!
Some files may have spelling errors.
copy and paste the following for where fails this test:
  goword expression/builtin_json.go

Aborting commit

➜  tidb git:(qi_json) ✗ goword expression/*.go
expression/builtin_arithmetic.go.92: // setFlenDecimal4Real is called to set proper `Flen` and `Decimal` of return (godoc-local: setFlenDecimal4Real -> setFlenDecimal4RealOrDecimal?)
expression/builtin_control.go.57: // Infer result type for builtin IF, IFNULL && NULLIF. (godoc-local: Infer -> inferType4ControlFuncs?)
expression/builtin_control.go.432: // See https://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html#function_if (godoc-local: See -> getFunction?)
expression/builtin_info.go.185: // eval evals a builtinUserSig. (godoc-local: eval -> evalString?)
expression/builtin_info_test.go.171: // Test case for tidb_server(). (godoc-export: Test -> TestTiDBVersion?)
expression/builtin_json.go.55: // Type of JSON value. (godoc-export: Type -> _?)
expression/builtin_json.go.57: // Unquote JSON value. (godoc-export: Unquote -> _?)
expression/builtin_json.go.59: // Create JSON array. (godoc-export: Create -> _?)
expression/builtin_json.go.61: // Create JSON object. (godoc-export: Create -> _?)
expression/builtin_json.go.63: // Return data from JSON document. (godoc-export: Return -> _?)
expression/builtin_json.go.65: // Insert data into JSON document. (godoc-export: Insert -> _?)
expression/builtin_json.go.67: // Insert data into JSON document. (godoc-export: Insert -> _?)
expression/builtin_json.go.69: // Replace values in JSON document. (godoc-export: Replace -> _?)
expression/builtin_json.go.71: // Remove data from JSON document. (godoc-export: Remove -> _?)
expression/builtin_json.go.73: // Merge JSON documents, preserving duplicate keys. (godoc-export: Merge -> _?)
expression/builtin_json.go.75: // Check JSON document contains specific target. (godoc-export: Check -> _?)
expression/builtin_math.go.539: // evalDec evals a builtinCeilIntToDecSig. (godoc-local: evalDec -> evalDecimal?)
expression/builtin_math.go.591: // evalDec evals a builtinCeilDecToDecSig. (godoc-local: evalDec -> evalDecimal?)
expression/builtin_math.go.724: // evalDec evals a builtinFloorIntToDecSig. (godoc-local: evalDec -> evalDecimal?)
expression/builtin_math.go.776: // evalDec evals a builtinFloorDecToDecSig. (godoc-local: evalDec -> evalDecimal?)
expression/builtin_math.go.1674: // evalreal evals a builtinSinSig. (godoc-local: evalreal -> evalReal?)
expression/builtin_math.go.1707: // eval evals a builtinTanSig. (godoc-local: eval -> evalReal?)
expression/builtin_other.go.105: // See https://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html#function_in (godoc-local: See -> builtinInIntSig?)
expression/builtin_other.go.154: // See https://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html#function_in (godoc-local: See -> builtinInStringSig?)
expression/builtin_other.go.187: // See https://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html#function_in (godoc-local: See -> builtinInRealSig?)
expression/builtin_other.go.220: // See https://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html#function_in (godoc-local: See -> builtinInDecimalSig?)
expression/builtin_other.go.253: // See https://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html#function_in (godoc-local: See -> builtinInTimeSig?)
expression/builtin_other.go.286: // See https://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html#function_in (godoc-local: See -> builtinInDurationSig?)
expression/builtin_other.go.319: // See https://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html#function_in (godoc-local: See -> builtinInJSONSig?)
expression/builtin_time.go.584: // calculateTimeDiff calculates interval difference of two types.Duration. (godoc-local: calculateTimeDiff -> calculateDurationTimeDiff?)
expression/builtin_time.go.1005: // See https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_monthname (godoc-local: See -> monthNameFunctionClass?)
expression/builtin_time.go.1747: // See https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_str-to-date (godoc-local: See -> getFunction?)
expression/builtin_time.go.1846: // TODO: If the NO_ZERO_DATE or NO_ZERO_IN_DATE SQL mode is enabled, zero dates or part of dates are disallowed. (godoc-local: TODO: -> evalDuration?)
expression/builtin_time.go.4963: // evalTime evals a builtinSubTimeDurationNullSig. (godoc-local: evalTime -> evalDuration?)
expression/builtin_time.go.5073: // See https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_time-format (godoc-local: See -> formatTime?)
expression/column.go.151: // This id is used to specify whether this column is ExtraHandleColumn or to access histogram. (godoc-export: This -> ID?)
expression/column.go.151: // This id is used to specify whether this column is ExtraHandleColumn or to access histogram. (godoc-export: This -> ID?)
expression/simple_rewriter.go.232: // 1. If op are EQ or NE or NullEQ, constructBinaryOpFunctions converts (a0,a1,a2) op (b0,b1,b2) to (a0 op b0) and (a1 op b1) and (a2 op b2) (godoc-local: 1. -> constructBinaryOpFunction?)

store is done. #9190

everything is done. #9219

I am going to close this issue as stale. I ran a goword check, and there are 500+ lines, but nothing looked obviously wrong.

Was this page helpful?
0 / 5 - 0 ratings