Commit cc0e97b
committed
Fix add_invertible_flag regression and ruff PIE810 violation
Restore the original add_invertible_flag logic where the argparse action
depends on the default value. The previous commit incorrectly simplified
this to always use store_true/store_false, which broke all 7 flags with
default=True (--no-namespace-packages, --no-warn-no-return,
--no-implicit-reexport, --no-color-output, --no-error-summary, etc).
The --pretty default is now controlled solely through Options.pretty=True
in options.py, keeping default=False in add_invertible_flag so the flag
semantics work correctly (--pretty -> store_true, --no-pretty -> store_false).
Also fix ruff PIE810 by merging startswith calls into a tuple.1 parent e36037e commit cc0e97b
2 files changed
+11
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
524 | 524 | | |
525 | 525 | | |
526 | 526 | | |
527 | | - | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
528 | 530 | | |
529 | | - | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
530 | 537 | | |
531 | 538 | | |
532 | 539 | | |
| |||
1000 | 1007 | | |
1001 | 1008 | | |
1002 | 1009 | | |
1003 | | - | |
| 1010 | + | |
1004 | 1011 | | |
1005 | 1012 | | |
1006 | 1013 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
0 commit comments