-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First Pull Request #1
Conversation
Warning Rate Limit Exceeded@nao1215 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 3 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. WalkthroughThe changes revamp a CSV project owned by Changes
Poem
TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
parser.go
Outdated
validatorList := make(validators, 0, len(tagList)) | ||
|
||
for _, t := range tagList { | ||
switch true { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
switchTrue: replace 'switch true {}' with 'switch {}' (gocritic)
validation.go
Outdated
|
||
// equalValidator is a struct that contains the validation rules for an equal column. | ||
type equalValidator struct { | ||
threshhold float64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶threshhold
is a misspelling of threshold
(misspell)
validation.go
Outdated
} | ||
|
||
// newEqualValidator returns a new equalValidator. | ||
func newEqualValidator(threshhold float64) *equalValidator { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶threshhold
is a misspelling of threshold
(misspell)
validation.go
Outdated
|
||
// newEqualValidator returns a new equalValidator. | ||
func newEqualValidator(threshhold float64) *equalValidator { | ||
return &equalValidator{threshhold: threshhold} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶threshhold
is a misspelling of threshold
(misspell)
) | ||
|
||
// tagValue is the struct tag value. | ||
type tagValue string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
type tagValue
is unused (unused)
} | ||
}) | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
unnecessary trailing newline (whitespace)
} | ||
|
||
fieldValue := structValue.Field(index) | ||
switch fieldValue.Kind() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
missing cases in switch of type reflect.Kind: reflect.Invalid, reflect.Bool, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, reflect.Float32, reflect.Float64, reflect.Complex64, reflect.Complex128, reflect.Array, reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Pointer|reflect.Ptr, reflect.Slice, reflect.Struct, reflect.UnsafePointer (exhaustive)
} | ||
|
||
elem := rv.Elem() | ||
switch elem.Kind() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
missing cases in switch of type reflect.Kind: reflect.Invalid, reflect.Bool, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, reflect.Float32, reflect.Float64, reflect.Complex64, reflect.Complex128, reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Pointer|reflect.Ptr, reflect.String, reflect.Struct, reflect.UnsafePointer (exhaustive)
parser.go
Outdated
|
||
for i := 0; i < structType.NumField(); i++ { | ||
fieldName := structType.Field(i).Name | ||
header = append(header, column(fieldName)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
SA4010: this result of append is never used, except maybe in other appends (staticcheck)
// The strutSlicePointer is a pointer to structure slice where validation rules are set in struct tags. | ||
// | ||
// Example: | ||
func (c *CSV) Decode(structSlicePointer any) []error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
ST1016: methods on the same type should have the same receiver name (seen 1x "csv", 2x "c") (stylecheck)
validation.go
Outdated
|
||
// equalValidator is a struct that contains the validation rules for an equal column. | ||
type equalValidator struct { | ||
threshhold float64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[misspell] reported by reviewdog 🐶
"threshhold" is a misspelling of "threshold"
validation.go
Outdated
} | ||
|
||
// newEqualValidator returns a new equalValidator. | ||
func newEqualValidator(threshhold float64) *equalValidator { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[misspell] reported by reviewdog 🐶
"threshhold" is a misspelling of "threshold"
validation.go
Outdated
|
||
// newEqualValidator returns a new equalValidator. | ||
func newEqualValidator(threshhold float64) *equalValidator { | ||
return &equalValidator{threshhold: threshhold} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[misspell] reported by reviewdog 🐶
"threshhold" is a misspelling of "threshold"
validation.go
Outdated
|
||
// newEqualValidator returns a new equalValidator. | ||
func newEqualValidator(threshhold float64) *equalValidator { | ||
return &equalValidator{threshhold: threshhold} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[misspell] reported by reviewdog 🐶
"threshhold" is a misspelling of "threshold"
validation.go
Outdated
return &equalValidator{threshhold: threshhold} | ||
} | ||
|
||
// Do validates the target is equal to the threshhold. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[misspell] reported by reviewdog 🐶
"threshhold" is a misspelling of "threshold"
validation.go
Outdated
|
||
// lessThanEqualValidator is a struct that contains the validation rules for a less than or equal column. | ||
type lessThanEqualValidator struct { | ||
threshhold float64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[misspell] reported by reviewdog 🐶
"threshhold" is a misspelling of "threshold"
validation.go
Outdated
} | ||
|
||
// newLessThanEqualValidator returns a new lessThanEqualValidator. | ||
func newLessThanEqualValidator(threshhold float64) *lessThanEqualValidator { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[misspell] reported by reviewdog 🐶
"threshhold" is a misspelling of "threshold"
validation.go
Outdated
|
||
// newLessThanEqualValidator returns a new lessThanEqualValidator. | ||
func newLessThanEqualValidator(threshhold float64) *lessThanEqualValidator { | ||
return &lessThanEqualValidator{threshhold: threshhold} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[misspell] reported by reviewdog 🐶
"threshhold" is a misspelling of "threshold"
validation.go
Outdated
|
||
// newLessThanEqualValidator returns a new lessThanEqualValidator. | ||
func newLessThanEqualValidator(threshhold float64) *lessThanEqualValidator { | ||
return &lessThanEqualValidator{threshhold: threshhold} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[misspell] reported by reviewdog 🐶
"threshhold" is a misspelling of "threshold"
validation.go
Outdated
return &lessThanEqualValidator{threshhold: threshhold} | ||
} | ||
|
||
// Do validates the target is less than or equal to the threshhold. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[misspell] reported by reviewdog 🐶
"threshhold" is a misspelling of "threshold"
This comment has been minimized.
This comment has been minimized.
@@ -0,0 +1,145 @@ | |||
// Package csv returns which columns have syntax errors on a per-line basis when reading CSV. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
: # github.com/nao1215/csv [github.com/nao1215/csv.test]
parser.go
Outdated
if err != nil { | ||
return err | ||
} | ||
csv.ruleSet = ruleSet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
undefined: csv (typecheck)
"bytes" | ||
"fmt" | ||
|
||
"github.com/nao1215/csv" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
could not import github.com/nao1215/csv (-: # github.com/nao1215/csv [github.com/nao1215/csv.test]
parser.go
Outdated
if err != nil { | ||
return err | ||
} | ||
csv.ruleSet = ruleSet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
undefined: csv) (typecheck)
This comment has been minimized.
This comment has been minimized.
} | ||
|
||
fieldValue := structValue.Field(index) | ||
switch fieldValue.Kind() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
missing cases in switch of type reflect.Kind: reflect.Invalid, reflect.Bool, reflect.Uintptr, reflect.Complex64, reflect.Complex128, reflect.Array, reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Pointer|reflect.Ptr, reflect.Slice, reflect.Struct, reflect.UnsafePointer (exhaustive)
Summary by CodeRabbit