mirror of
https://github.com/mgechev/revive.git
synced 2025-01-08 03:13:27 +02:00
8c2cd33315
* fixing comments spacing * Updating comment spacing test cases * adds test cases for multiline comments --------- Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
42 lines
715 B
Go
42 lines
715 B
Go
package commentspacings
|
|
|
|
//revive:disable:cyclomatic
|
|
type some struct{}
|
|
|
|
//revive:disable:cyclomatic High complexity score but easy to understand
|
|
type some1 struct{}
|
|
|
|
// Some nice comment
|
|
//
|
|
// With an empty line in the middle will make the rule panic!
|
|
func itsATrap() {}
|
|
|
|
// This is a well formed comment
|
|
type hello struct {
|
|
random `json:random`
|
|
}
|
|
|
|
// MATCH:21 /no space between comment delimiter and comment text/
|
|
|
|
//This comment does not respect the spacing rule!
|
|
var a string
|
|
|
|
//myOwnDirective: do something
|
|
|
|
/*
|
|
Should be valid
|
|
*/
|
|
|
|
// Tabs between comment delimeter and comment text should be fine
|
|
|
|
// MATCH:34 /no space between comment delimiter and comment text/
|
|
|
|
/*Not valid
|
|
*/
|
|
|
|
/* valid
|
|
*/
|
|
|
|
/* valid
|
|
*/
|