mirror of
https://github.com/mgechev/revive.git
synced 2025-01-10 03:17:11 +02:00
55cfae63e9
* adds support for comments when enabling/disabling * adds config flag to require disabling reason * Update lint/file.go adds code fmt suggestion by @mgechev Co-Authored-By: Minko Gechev <mgechev@gmail.com> * moves regexp compilation out of the function fix typo in condition * adds support for comments when enabling/disabling * skips incomplete directives and generate a failure * adds _directive_ concept to cope with specify-disable-reason * adds doc gofmt * fixes severity is ignored
39 lines
1.1 KiB
Go
39 lines
1.1 KiB
Go
package fixtures
|
|
|
|
func foo1() {
|
|
//revive:disable-next-line:var-naming
|
|
var invalid_name = 0
|
|
var invalid_name2 = 1 //revive:disable-line:var-naming
|
|
}
|
|
|
|
func foo11() {
|
|
//revive:disable-next-line:var-naming I'm an Eiffel programmer thus I like underscores
|
|
var invalid_name = 0
|
|
var invalid_name2 = 1 //revive:disable-line:var-naming I'm an Eiffel programmer thus I like underscores
|
|
}
|
|
|
|
|
|
func foo2() {
|
|
// revive:disable-next-line:var-naming
|
|
//revive:disable
|
|
var invalid_name = 0
|
|
var invalid_name2 = 1
|
|
}
|
|
|
|
func foo3() {
|
|
//revive:enable
|
|
// revive:disable-next-line:var-naming
|
|
var invalid_name = 0
|
|
// not a valid annotation revive:disable-next-line:var-naming
|
|
var invalid_name2 = 1 // MATCH /don't use underscores in Go names; var invalid_name2 should be invalidName2/
|
|
/* revive:disable-next-line:var-naming */
|
|
var invalid_name3 = 0 // MATCH /don't use underscores in Go names; var invalid_name3 should be invalidName3/
|
|
}
|
|
|
|
func foo2p1() {
|
|
//revive:disable Underscores are fine
|
|
var invalid_name = 0
|
|
//revive:enable No! Underscores are not nice!
|
|
var invalid_name2 = 1 // MATCH /don't use underscores in Go names; var invalid_name2 should be invalidName2/
|
|
}
|