1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-23 22:04:49 +02:00

Introduce the empty-lines rule that verifies there are no {head,trail}ing lines (#81)

This commit is contained in:
Genadi Samokovarov
2018-10-11 14:52:46 -07:00
committed by Minko Gechev
parent da63d0a965
commit d2e0e5a0ed
5 changed files with 190 additions and 0 deletions

View File

@@ -56,6 +56,11 @@ func (f *File) Render(x interface{}) string {
return buf.String()
}
// CommentMap builds a comment map for the file.
func (f *File) CommentMap() ast.CommentMap {
return ast.NewCommentMap(f.Pkg.fset, f.AST, f.AST.Comments)
}
var basicTypeKinds = map[types.BasicKind]string{
types.UntypedBool: "bool",
types.UntypedInt: "int",