Abirdcfly / dupword

A linter that checks for duplicate words in the source code (usually miswritten)
MIT License
13 stars 5 forks source link

bug: duplicate words not found in camel case / structs #37

Open adamdecaf opened 5 months ago

adamdecaf commented 5 months ago

I've go the following struct which i would think should trigger duplicate word detection. After skimming the code I think the duplicate aren't found for two major reasons.

  1. camel case identifiers aren't split into separate words
  2. struct fields / tags aren't inspected
type UnderwritingCardVolumeDistribution struct {
    CardPresentPercentagePercentage int64 `json:"cardPresentPercentage,omitempty"` // want `Duplicate words \(Percentage\) found`

    CardPresentPercentage int64 `json:"cardPresentPercentagePercentage,omitempty"` // want `Duplicate words \(Percentage\) found`
}
Abirdcfly commented 5 months ago

Thanks for the suggestion, it's true that the current release didn't handle CamelCase words, and it's true that we should try to add this feature in the next release.