Sat, 06 Mar 2021 23:43:44 -0500 typing: add some type annotations to mercurial/pathutil.py
Matt Harbison <matt_harbison@yahoo.com> [Sat, 06 Mar 2021 23:43:44 -0500] rev 46685
typing: add some type annotations to mercurial/pathutil.py Differential Revision: https://phab.mercurial-scm.org/D10128
Sat, 06 Mar 2021 23:41:32 -0500 typing: add some type annotations to mercurial/util.py
Matt Harbison <matt_harbison@yahoo.com> [Sat, 06 Mar 2021 23:41:32 -0500] rev 46684
typing: add some type annotations to mercurial/util.py Differential Revision: https://phab.mercurial-scm.org/D10127
Sat, 06 Mar 2021 18:51:33 -0500 typing: add some type annotations to mercurial/phases.py
Matt Harbison <matt_harbison@yahoo.com> [Sat, 06 Mar 2021 18:51:33 -0500] rev 46683
typing: add some type annotations to mercurial/phases.py Some of these were helpful in typing other modules, and then I typed the easy-ish ones. Black forces the long `Phasedefaults` definition to be wrapped, which pytype seems OK with (as shown with `reveal_type()`), but it does seem to confuse PyCharm a bit. Differential Revision: https://phab.mercurial-scm.org/D10126
Sat, 06 Mar 2021 17:52:09 -0500 typing: add type annotations to the public methods of mercurial/subrepoutil.py
Matt Harbison <matt_harbison@yahoo.com> [Sat, 06 Mar 2021 17:52:09 -0500] rev 46682
typing: add type annotations to the public methods of mercurial/subrepoutil.py Differential Revision: https://phab.mercurial-scm.org/D10125
Sat, 06 Mar 2021 15:58:23 -0500 typing: add type annotations to mercurial/i18n.py
Matt Harbison <matt_harbison@yahoo.com> [Sat, 06 Mar 2021 15:58:23 -0500] rev 46681
typing: add type annotations to mercurial/i18n.py I'm a little unsure of this because `gettext()` clearly allows for passing unicode. But the comments seem to indicate that this is related to tests, and this was useful for catching unicode being passed to `_()` in the keyring extension. I'm also not sure why `_(None)` would make any sense, so maybe the argument shouldn't be optional? I didn't add it to the lambda in plain mode because that spilled beyond 80 characters and so black mangled it. Black and pytype disagree on where the comment to disable a check needs to go, so this has to disable and then enable the checking. Differential Revision: https://phab.mercurial-scm.org/D10124
Sat, 06 Mar 2021 15:26:46 -0500 typing: add type annotations to mercurial/utils/dateutil.py
Matt Harbison <matt_harbison@yahoo.com> [Sat, 06 Mar 2021 15:26:46 -0500] rev 46680
typing: add type annotations to mercurial/utils/dateutil.py 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.) Differential Revision: https://phab.mercurial-scm.org/D10123
(0) -30000 -10000 -3000 -1000 -300 -100 -30 -10 -6 +6 +10 +30 +100 +300 +1000 +3000 tip