diff --git a/checkers/deprecatedComment_checker.go b/checkers/deprecatedComment_checker.go index ad40dbd4c..15235919c 100644 --- a/checkers/deprecatedComment_checker.go +++ b/checkers/deprecatedComment_checker.go @@ -28,6 +28,7 @@ func FuncOld() int` regexp.MustCompile(`(?i)this (?:function|type) is deprecated`), regexp.MustCompile(`(?i)deprecated[.!]? use \S* instead`), regexp.MustCompile(`(?i)\[\[deprecated\]\].*`), + regexp.MustCompile(`(?i)note: deprecated\b.*`), // TODO(quasilyte): more of these? } diff --git a/checkers/testdata/deprecatedComment/negative_tests.go b/checkers/testdata/deprecatedComment/negative_tests.go index a51f61cc4..08045c2a2 100644 --- a/checkers/testdata/deprecatedComment/negative_tests.go +++ b/checkers/testdata/deprecatedComment/negative_tests.go @@ -14,3 +14,6 @@ type deprecated struct{} // Derpecated is a type name. type Derpecated struct{} + +// Note that this one is not deprecated. +func f() {} diff --git a/checkers/testdata/deprecatedComment/positive_tests.go b/checkers/testdata/deprecatedComment/positive_tests.go index bacbf1228..6de204777 100644 --- a/checkers/testdata/deprecatedComment/positive_tests.go +++ b/checkers/testdata/deprecatedComment/positive_tests.go @@ -129,3 +129,13 @@ var ( // DERPecate: ... _ = 0 ) + +/*! the proper format is `Deprecated: ` */ +// NOTE: Deprecated. Use bar instead. +func foo1() { +} + +/*! the proper format is `Deprecated: ` */ +// NOTE: Deprecated. +func foo2() { +}