From a800815aaaeb7375b21b9d17e905e470d10cdea2 Mon Sep 17 00:00:00 2001 From: "Iskander (Alex) Sharipov" Date: Sun, 20 Jan 2019 19:47:07 +0000 Subject: [PATCH] checkers: add Depreacted typo pattern (#776) Add a new pattern for deprecatedComment checker Fixes #723 Signed-off-by: Iskander Sharipov --- checkers/deprecatedComment_checker.go | 1 + checkers/testdata/deprecatedComment/positive_tests.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/checkers/deprecatedComment_checker.go b/checkers/deprecatedComment_checker.go index 15235919c..d68e32fa8 100644 --- a/checkers/deprecatedComment_checker.go +++ b/checkers/deprecatedComment_checker.go @@ -48,6 +48,7 @@ func FuncOld() int` "Deprecate: ", "Derpecate: ", "Derpecated: ", + "Depreacted: ", } for i := range c.commonTypos { c.commonTypos[i] = strings.ToUpper(c.commonTypos[i]) diff --git a/checkers/testdata/deprecatedComment/positive_tests.go b/checkers/testdata/deprecatedComment/positive_tests.go index 6de204777..c613e84bd 100644 --- a/checkers/testdata/deprecatedComment/positive_tests.go +++ b/checkers/testdata/deprecatedComment/positive_tests.go @@ -128,6 +128,10 @@ var ( /*! typo in `DERPecate`; should be `Deprecated` */ // DERPecate: ... _ = 0 + + /*! typo in `Depreacted`; should be `Deprecated` */ + // Depreacted: ... + _ = 0 ) /*! the proper format is `Deprecated: ` */