Closed kiri11 closed 3 months ago
Attention: Patch coverage is 83.33333%
with 3 lines
in your changes missing coverage. Please review.
Project coverage is 91.26%. Comparing base (
56cd1f9
) to head (71986bf
).
Files | Patch % | Lines |
---|---|---|
libcst/codemod/_cli.py | 57.14% | 3 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Thanks!
Summary
Original idea belongs to @jschavesr. I am just resubmitting his abandoned PR. Fixes the issue: https://github.com/Instagram/LibCST/issues/1183
Context warning messages were not being cleaned between files, so warnings from one files could be passed to other files in the context. Because of that warnings were being shown wrongly in the summary and the total number of warnings was wrong as well.
I also encountered another error in Windows CI. Seems like codemodding small files happens faster than the timer counts more than zero (probably less precision on Windows). So fixing that, too.
Test Plan
Before:
Running
convert_format_to_fstring.ConvertFormatStringCommand
on three files with identical contents:All three are the same, so they should get one warning each. But instead every following file gets more warnings copied from previous files:
The new test fails:
After:
Each file generates one warning correctly:
And the new test passes.