This is an archive of the discontinued Mercurial Phabricator instance.

typing: add type annotations to mercurial/utils/dateutil.py
ClosedPublic

Authored by mharbison72 on Mar 6 2021, 7:45 PM.

Details

Summary

For now, I'm just typing around the edges to help find issues with TortoiseHg.
If the custom hgdate type is useful elsewhere as I go, I'll move it to a file
dedicated to custom types. I'm not loving the ban on camelcase type names here
that test-check-code.t flagged, but I'm not sure how to disable that even if
everyone agreed that it's a bad idea to go against the normal convention for
types.

While here, fix an issue that pytype found in parsedate when an invalid date
tuple is passed by raising a ProgrammingError instead of crashing. (Tuple
doesn't have a strip attribute.)

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mharbison72 created this revision.Mar 6 2021, 7:45 PM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.