Commit ae1c6c7
Fix
* Remove redundant `line` argument in `unnecessary-lambda` add_message call
Lambdas never have `.position` set, so `_add_one_message` already
extracts `node.fromlineno`, passing it explicitly was a no-op.
* Use `assigned` node directly for `invalid-all-format` instead of module node
Pass the `__all__` value node to `add_message` instead of the module node
with manual line/col overrides. This also provides end_lineno/end_col_offset
for a more precise diagnostic span.
Existing callers that combined both location and nodes have been fixed:
- Redundant overrides removed (consider-using-f-string, too-many-try-statements,
consider-using-augmented-assign, consider-refactoring-into-while-condition) except useless-else-on-loop.
Co-authored-by: Claude Opus 4.6 <[email protected]>BaseChecker.add_message unnecessary overrides (#10899)1 parent b5e9607 commit ae1c6c7
8 files changed
Lines changed: 9 additions & 25 deletions
File tree
- pylint
- checkers
- base
- refactoring
- extensions
- tests/functional/i/invalid/invalid_all
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
574 | 574 | | |
575 | 575 | | |
576 | 576 | | |
577 | | - | |
| 577 | + | |
578 | 578 | | |
579 | 579 | | |
580 | 580 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
547 | | - | |
548 | | - | |
549 | | - | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
| 418 | + | |
424 | 419 | | |
425 | 420 | | |
426 | 421 | | |
| |||
444 | 439 | | |
445 | 440 | | |
446 | 441 | | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
| 442 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3223 | 3223 | | |
3224 | 3224 | | |
3225 | 3225 | | |
3226 | | - | |
3227 | | - | |
| 3226 | + | |
3228 | 3227 | | |
3229 | 3228 | | |
3230 | 3229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
69 | | - | |
| 67 | + | |
70 | 68 | | |
71 | 69 | | |
72 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
354 | | - | |
355 | | - | |
356 | 354 | | |
357 | 355 | | |
358 | 356 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
87 | 86 | | |
88 | 87 | | |
89 | 88 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
0 commit comments