cuonglm / gocmt Goto Github PK
View Code? Open in Web Editor NEWAdd missing comment on exported function, method, type, constant, variable in go file
License: Other
Add missing comment on exported function, method, type, constant, variable in go file
License: Other
Hi, I want to add some linter to avoid writing function which is public but uncomment.
It's the contrary of this tool.
Because we are an open-source repo(https://github.com/apache/incubator-devlake), we need to write more normative code.
Could you help me ๐?
now, the method need prefix for golint, is there any plan for support it? such as:
go lint report
gorose/orm.go
Line 81: warning: comment on exported method Orm.Table should be of the form "Table ..." (golint)
orm.go source code
func (dba *Orm) Table(tab interface{}) IOrm {
dba.GetISession().Bind(tab)
//dba.table = dba.GetISession().GetTableName()
return dba
}
this need the comment like // Orm.Table ...
, not // Table ...
Produce steps:
main.go
in foo
directory:package p
import "log"
// I ...
var I = 1
func a() {
// LogAll ...
var LogAll map[string]struct{}
log.Println(LogAll)
}
gocmt -d foo -i
Result:
$ cat foo/main.go
package p
import "log"
// I ...
var I = 1
func a() {
// LogAll ...
// LogAll ...
var LogAll map[string]struct{}
log.Println(LogAll)
}
Go 1.18 introduced generics, and gocmt can not handle the generics things.
Based on my testing, updating the Go version resolves issues with the AST parser and allows it to function correctly.
gocmt -d . -i
also modifies vendored folders.
The default behaviour should be to ignore it, since you almost never want your vendored packages to be modified.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.