cuonglm / Gocmt
Licence: other
Add missing comment on exported function, method, type, constant, variable in go file
Stars: ✭ 111
Labels
Projects that are alternatives of or similar to Gocmt
Scopelint
scopelint checks for unpinned variables in go programs
Stars: ✭ 110 (-0.9%)
Mutual labels: golang-tools, lint
Vermin
The smart virtual machines manager. A modern CLI for Vagrant Boxes.
Stars: ✭ 110 (-0.9%)
Mutual labels: golang-tools
Marlow
golang generator for type-safe sql api constructs
Stars: ✭ 83 (-25.23%)
Mutual labels: golang-tools
Linter
Linting your CSS to limit yourself to a defined subset of values.
Stars: ✭ 100 (-9.91%)
Mutual labels: lint
Mutest
fork of mutant with inline disable comments and a few different mutations.
Stars: ✭ 75 (-32.43%)
Mutual labels: lint
Zb
an opinionated repo based tool for linting, testing and building go source
Stars: ✭ 111 (+0%)
Mutual labels: lint
Update
Update is a new developer framework and CLI for automating updates of any kind in code projects. If you know how to use assemble, generate or verb, you'll know how to use update.
Stars: ✭ 106 (-4.5%)
Mutual labels: lint
Commit Message Lint
Github app to validate commit message on a pull request
Stars: ✭ 87 (-21.62%)
Mutual labels: lint
Node Developer Boilerplate
🍭 Boilerplate for ES6+ Node.js and npm Developer
Stars: ✭ 82 (-26.13%)
Mutual labels: lint
Lint Diff
💅 Run eslint only in the changed parts of the code
Stars: ✭ 92 (-17.12%)
Mutual labels: lint
Pytorch Project Template
Deep Learning project template for PyTorch (Distributed Learning is supported)
Stars: ✭ 76 (-31.53%)
Mutual labels: lint
Go Mygen
Quickly generate CURD and documentation for operating MYSQL.etc
Stars: ✭ 94 (-15.32%)
Mutual labels: golang-tools
Comment.js
[Archived] A tiny comment system based on Github issue comments.
Stars: ✭ 111 (+0%)
Mutual labels: comment
gocmt - Add missing comment on exported function, method, type, constant, variable in go file
Installation
go get -u github.com/cuonglm/gocmt
Why gocmt
Some of my projects have many files with exported fields, variables, functions missing comment, so lint tools will complain.
I find a way to auto add missing comment to them, just to pass the lint tools but nothing existed.
So gocmt
comes in.
Usage
$ gocmt -h
usage: gocmt [flags] [file ...]
-d string
Directory to process
-i Make in-place editing
-t string
Comment template (default "...")
Example
$ cat testdata/main.go
package p
var i = 0
var I = 1
var c = "constant un-exported"
const C = "constant exported"
type t struct{}
type T struct{}
func main() {
}
func unexport(s string) {
}
func Export(s string) {
}
func ExportWithComment(s string) {
}
Using gocmt
give you:
$ gocmt testdata/main.go
package p
var i = 0
// I ...
var I = 1
var c = "constant un-exported"
// C ...
const C = "constant exported"
type t struct{}
// T ...
type T struct{}
func main() {
}
func unexport(s string) {
}
// Export ...
func Export(s string) {
}
// ExportWithComment ...
func ExportWithComment(s string) {
}
Default template is ...
, you can change it using -t
option.
Author
Cuong Manh Le [email protected]
License
See LICENSE
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].