Anki-Android icon indicating copy to clipboard operation
Anki-Android copied to clipboard

NF: simplify Time and improve lint message

Open Arthur-Milchior opened this issue 1 year ago • 6 comments

Lint message around system time was not update when Time was moved to Collection from TimeManager.

In my opinion, code is more readable if you just uses Time.s and Time.ms than TimeManager.Time.intTime. On top of that, it becomes clear when time is returned in seconds.

This way, most developer can just write code without needing to have any knowledge about time management, unless they have a test that requires to manipulate it explicitly.

As a next step, we may try to figure out whether methods that require Time really need them. Most seems to directly gets TimeManager.time in all call. But this seems less important than lint (this one is mandatory) and simplifying our abstraction for new contributors.

Arthur-Milchior avatar Aug 02 '22 22:08 Arthur-Milchior

This one was strange. Backticks in Description made the test failed. For some reason, Kotlin would just not print two backticks. However if the string has a single backtick, it works. No idea why. Not important for this case either

Arthur-Milchior avatar Aug 03 '22 23:08 Arthur-Milchior

Conflicts need to be resolved.

ShridharGoel avatar Aug 05 '22 12:08 ShridharGoel

Done

Arthur-Milchior avatar Aug 07 '22 15:08 Arthur-Milchior

Nothing more from me, just the question lukstbit asked. I think it is probably typo like the previous one ?

thedroiddiv avatar Aug 08 '22 15:08 thedroiddiv

What kind of typealias do you want? milisecond and Second?

Arthur-Milchior avatar Aug 24 '22 01:08 Arthur-Milchior

EpochS and EpochMs seems sensible

david-allison avatar Aug 26 '22 15:08 david-allison

Hello 👋, this PR has been opened for more than 2 months with no activity on it. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically

github-actions[bot] avatar Nov 23 '22 19:11 github-actions[bot]