> Python lint takes 4-5mins to complete. I think if the mypy analysis is
really on the order of 10s, the additional time won't matter and could
always be enabled.

+1 of course it would be nice to make mypy as fast as possible, but I don't
think speed needs to be a blocker. The productivity gains we'd get from
reliable type analysis more than offset the cost IMO.

On Mon, Mar 2, 2020 at 2:03 PM Luke Cwik <lc...@google.com> wrote:

> Python lint takes 4-5mins to complete. I think if the mypy analysis is
> really on the order of 10s, the additional time won't matter and could
> always be enabled.
>
> On Mon, Mar 2, 2020 at 1:21 PM Chad Dombrova <chad...@gmail.com> wrote:
>
>> I believe that mypy via pre-commit hook will be faster than 10s since it
>>> only applies to modified files.
>>>
>>
>> Correct, with a few caveats:
>>
>>    - pre-commit can be setup to only run if a python file changes.  so
>>    modifying a java file won't trigger mypy to run.
>>    - if *any* python file changes mypy has to run on the whole codebase,
>>    because a change to one file can affect the others (i.e. a function arg
>>    type changes).  it's not really meaningful to run mypy on a single file.
>>    - the mypy daemon tracks which files have changed, and runs
>>    incremental updates.  so if we setup the precommit hook to run the daemon,
>>    we should see that get appreciably faster.  I'll do some tests and report
>>    back.
>>
>>

Reply via email to