Commit 46a55b2
make --remove-unused-ignores a no-op for files with no unused ignores (#2217)
Summary:
Fixes #2185
This change makes `--remove-unused-ignores` avoid rewriting files when there are no unused ignores to remove.
Files that have no ignore comments, or only have used ignore comments, are now left untouched. This prevents unnecessary file writes and avoids introducing formatting-only changes such as added newlines.
Pull Request resolved: #2217
Test Plan: Added tests to verify no newline characters are appended to input when there are no unused ignores to remove.
Reviewed By: stroxler
Differential Revision: D91474177
Pulled By: yangdanny97
fbshipit-source-id: 65651cf15219074f9edd77a086280609205e56a41 parent bdac377 commit 46a55b2
2 files changed
Lines changed: 30 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
404 | 409 | | |
405 | 410 | | |
406 | 411 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
376 | | - | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
377 | 379 | | |
378 | 380 | | |
379 | 381 | | |
| |||
490 | 492 | | |
491 | 493 | | |
492 | 494 | | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
497 | 501 | | |
498 | 502 | | |
499 | 503 | | |
| |||
912 | 916 | | |
913 | 917 | | |
914 | 918 | | |
915 | | - | |
916 | | - | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
917 | 923 | | |
918 | 924 | | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
919 | 937 | | |
920 | 938 | | |
921 | 939 | | |
| |||
0 commit comments