Skip to content

Commit

Permalink
checkers: add Depreacted typo pattern (go-critic#776)
Browse files Browse the repository at this point in the history
Add a new pattern for deprecatedComment checker

Fixes go-critic#723

Signed-off-by: Iskander Sharipov <[email protected]>
  • Loading branch information
quasilyte authored Jan 20, 2019
1 parent 84e9e83 commit a800815
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions checkers/deprecatedComment_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func FuncOld() int`
"Deprecate: ",
"Derpecate: ",
"Derpecated: ",
"Depreacted: ",
}
for i := range c.commonTypos {
c.commonTypos[i] = strings.ToUpper(c.commonTypos[i])
Expand Down
4 changes: 4 additions & 0 deletions checkers/testdata/deprecatedComment/positive_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -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: <text>` */
Expand Down

0 comments on commit a800815

Please sign in to comment.