diff options
| author | Xe Iaso <me@xeiaso.net> | 2023-06-24 07:22:47 -0400 |
|---|---|---|
| committer | Xe Iaso <me@xeiaso.net> | 2023-06-24 07:24:17 -0400 |
| commit | 6e8d83bb628cc3fff6b6bfc22cc7f769a02b934f (patch) | |
| tree | f876db2af9efd249d6cc566a467cd4c37363fdde | |
| parent | 7724fa5a14ce57640659bb57cd1b78ef95273952 (diff) | |
| download | x-6e8d83bb628cc3fff6b6bfc22cc7f769a02b934f.tar.xz x-6e8d83bb628cc3fff6b6bfc22cc7f769a02b934f.zip | |
linters/nosleep: change magic comment formatv1.6.0
Thanks @dominikh for pointing me to the right syntax to use for magic
comments as used by linters.
Signed-off-by: Xe Iaso <me@xeiaso.net>
| -rw-r--r-- | linters/nosleep/nosleep.go | 4 | ||||
| -rw-r--r-- | linters/nosleep/testdata/sleep_test.go | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/linters/nosleep/nosleep.go b/linters/nosleep/nosleep.go index f5f0728..58b55d1 100644 --- a/linters/nosleep/nosleep.go +++ b/linters/nosleep/nosleep.go @@ -6,7 +6,7 @@ // // If god is dead and you need to do this anyways, add a comment that reads: // -// // nosleep bypass(yournick): put a reason why here +// //nosleep:bypass put a reason why here package nosleep import ( @@ -25,7 +25,7 @@ var Analyzer = &analysis.Analyzer{ Run: run, } -var bypassRegex = regexp.MustCompile(`^// nosleep bypass\((\w+)\): ([\w \.\!\,]+)`) +var bypassRegex = regexp.MustCompile(`^//nosleep:bypass ([\w \.\!\,]+)`) // nodeFuncName converts an ast.CallExpr into the human-readable name of // the function and name. diff --git a/linters/nosleep/testdata/sleep_test.go b/linters/nosleep/testdata/sleep_test.go index 0d47045..d334d4e 100644 --- a/linters/nosleep/testdata/sleep_test.go +++ b/linters/nosleep/testdata/sleep_test.go @@ -10,5 +10,5 @@ func TestNosleep(t *testing.T) { } func TestNosleepIgnore(t *testing.T) { - time.Sleep(time.Second) // nosleep bypass(Mai): This test requires us to use a sleep statement here. I hate it too. + time.Sleep(time.Second) //nosleep:bypass This test requires us to use a sleep statement here. I hate it too. } |
