Skip to content
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

time-naming missing cases #571

Closed
butuzov opened this issue Sep 10, 2021 · 0 comments · Fixed by #572
Closed

time-naming missing cases #571

butuzov opened this issue Sep 10, 2021 · 0 comments · Fixed by #572

Comments

@butuzov
Copy link
Contributor

butuzov commented Sep 10, 2021

Describe the bug
time-naming check missing cases.

  • Hours (all other hour related case)
  • Min (as in RULES_DESCRIPTIONS.md) (all other minute related case)
  • Singular Forms

To Reproduce

Hour     = time.Hour      // MATCH /var Hour is of type time.Duration; don't use unit-specific suffix "Hour"/
oneHour  = time.Hour      // MATCH /var oneHour is of type time.Duration; don't use unit-specific suffix "Hour"/
twoHours = 2 * time.Hour  // MATCH /var twoHours is of type time.Duration; don't use unit-specific suffix "Hours"/
TenHours = 10 * time.Hour // MATCH /var TenHours is of type time.Duration; don't use unit-specific suffix "Hours"/
SixHours = 6 * time.Hour  // MATCH /var SixHours is of type time.Duration; don't use unit-specific suffix "Hours"/

oneMin     = time.Minute     // MATCH /var oneMin is of type time.Duration; don't use unit-specific suffix "Min"/
Min        = time.Minute     // MATCH /var Min is of type time.Duration; don't use unit-specific suffix "Min"/
twoMin     = 2 * time.Minute // MATCH /var twoMin is of type time.Duration; don't use unit-specific suffix "Min"/
SixMin     = 6 * time.Minute // MATCH /var SixMin is of type time.Duration; don't use unit-specific suffix "Min"/
SixMins    = 6 * time.Minute // MATCH /var SixMins is of type time.Duration; don't use unit-specific suffix "Mins"/
SixMinutes = 6 * time.Minute // MATCH /var SixMinutes is of type time.Duration; don't use unit-specific suffix "Minutes"/

Expected behavior

to match duration variables

Additional context
Found on testing revive integration.

@butuzov butuzov mentioned this issue Sep 10, 2021
3 tasks
mgechev pushed a commit that referenced this issue Sep 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant