-
Notifications
You must be signed in to change notification settings - Fork 298
time-date: add rule to check for time.Date usage #1327
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
Conversation
Based on the different feedbacks I got, this PR should reconsidered. Let's continue the discussion in the issue, where I gathered the feedbacks I got, and try to provide a replies to them |
I'm closing it for now. The time I spend on this is not a pure lost because I played with revive internals to sea with the test. I might come back later with suggestions I have for tests/until_test.go |
Based on feedback provided here by @chavacava I resurrect this PR, address the comment made by @denisvmedia. I might discard some of them if they are in contradiction with what @chavacava said. But each of them will be reviewed and have a comment. So for now,let's consider it's a draft again |
I applied changes: The confidence level now varies:
Please let me know if these values are ok or not |
@alexandear please review again. |
I have pushed again by simplifying the logging logic |
I apparently forgot to push back my changes 😅🤦♂️ |
@denisvmedia @alexandear @chavacava Could you please review again? |
Still some markdown linter failures. I'll merge as soon as checks pass |
This commit introduces a new rule to check for the usage of time.Date The rule is added to report the usage of time.Date with non-decimal literals Here the leading zeros that seems OK, forces the value to be octal literals. time.Date(2023, 01, 02, 03, 04, 05, 06, time.UTC) gofumpt formats the code like this when it encounters leading zeroes. time.Date(2023, 0o1, 0o2, 0o3, 0o4, 0o5, 0o6, time.UTC) The rule reports anything that is not a decimal literal.
This commit introduces a new rule to check for the usage of
time.Date
The rule is added to report the usage of
time.Date
with non-decimal literalsHere the leading zeros that seem OK, forces the value to be octal literals.
gofumpt formats the code like this when it encounters leading zeroes.
The rule also reports anything that is not a decimal literal. Please take a look at the testdata file.
Closes #1326