mirror of
https://github.com/mgechev/revive.git
synced 2025-11-23 22:04:49 +02:00
docs: fix typo in comments (#1037)
This commit is contained in:
@@ -12,7 +12,7 @@ Please contribute to this repository if any of the following is true:
|
||||
Prerequisites:
|
||||
|
||||
* Familiarity with [GitHub PRs](https://help.github.com/articles/using-pull-requests) (pull requests) and issues.
|
||||
* Knowledge of Go and familarity with static code analysis, or tech writing.
|
||||
* Knowledge of Go and familiarity with static code analysis, or tech writing.
|
||||
|
||||
## Submitting a Pull Request
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ func (w *lintExported) lintTypeDoc(t *ast.TypeSpec, doc *ast.CommentGroup) {
|
||||
break
|
||||
}
|
||||
}
|
||||
// if comment starts wih name of type and has some text after - it's ok
|
||||
// if comment starts with name of type and has some text after - it's ok
|
||||
expectedPrefix := t.Name.Name+" "
|
||||
if strings.HasPrefix(s, expectedPrefix){
|
||||
return
|
||||
|
||||
@@ -68,7 +68,7 @@ func (r *ImportAliasNamingRule) Apply(file *lint.File, arguments lint.Arguments)
|
||||
}
|
||||
|
||||
alias := is.Name
|
||||
if alias == nil || alias.Name == "_" || alias.Name == "." { // "_" and "." are special types of import aiases and should be processed by another linter rule
|
||||
if alias == nil || alias.Name == "_" || alias.Name == "." { // "_" and "." are special types of import aliases and should be processed by another linter rule
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ const (
|
||||
ruleUTAMessageIgnored = "type assertion result ignored"
|
||||
)
|
||||
|
||||
// UncheckedTypeAssertionRule lints missing or ignored `ok`-value in danymic type casts.
|
||||
// UncheckedTypeAssertionRule lints missing or ignored `ok`-value in dynamic type casts.
|
||||
type UncheckedTypeAssertionRule struct {
|
||||
sync.Mutex
|
||||
acceptIgnoredAssertionResult bool
|
||||
|
||||
@@ -140,7 +140,7 @@ type instruction struct {
|
||||
Confidence float64 // confidence level
|
||||
}
|
||||
|
||||
// JSONInstruction structure used when we parse json object insted of classic MATCH string
|
||||
// JSONInstruction structure used when we parse json object instead of classic MATCH string
|
||||
type JSONInstruction struct {
|
||||
Match string `json:"MATCH"`
|
||||
Category string `json:"Category"`
|
||||
|
||||
2
testdata/comment-spacings.go
vendored
2
testdata/comment-spacings.go
vendored
@@ -27,7 +27,7 @@ var a string
|
||||
Should be valid
|
||||
*/
|
||||
|
||||
// Tabs between comment delimeter and comment text should be fine
|
||||
// Tabs between comment delimiter and comment text should be fine
|
||||
|
||||
// MATCH:34 /no space between comment delimiter and comment text/
|
||||
|
||||
|
||||
2
testdata/exported-issue-1002.go
vendored
2
testdata/exported-issue-1002.go
vendored
@@ -1,7 +1,7 @@
|
||||
// Package golint comment
|
||||
package golint
|
||||
|
||||
// by default code bellow is valid,
|
||||
// by default code below is valid,
|
||||
// but if checkPublicInterface is switched on - it should check documentation in interfaces
|
||||
|
||||
// Some - some interface
|
||||
|
||||
@@ -3,7 +3,7 @@ package fixtures
|
||||
var foo any = "foo"
|
||||
|
||||
func handleIgnoredIsOKByConfig() {
|
||||
// No lint here bacuse `acceptIgnoredAssertionResult` is set to `true`
|
||||
// No lint here because `acceptIgnoredAssertionResult` is set to `true`
|
||||
r, _ := foo.(int)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user