| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Pablo might need to update his "Attracts linker errors" line to "Attracts linker errors and unused imports," I think I see a pattern in the affected files ;-)
Sorry, something went wrong.
Attracts lin[kt]er errors |
Sorry, something went wrong.
There was a problem hiding this comment.
(I only reviewed the changes to the config files)
Sorry, something went wrong.
| [per-file-target-version] | ||
| "jit/example_trace_dump.py" = "py312" # Reused-quote f-strings (PEP 701) |
There was a problem hiding this comment.
should this be the target version for the whole jit directory, rather than just one file...?
Sorry, something went wrong.
There was a problem hiding this comment.
Sure, updated.
Sorry, something went wrong.
| [lint.per-file-ignores] | ||
| "c-analyzer/c_parser/__init__.py" = ["F401"] # Re-exports from submodules | ||
| "c-analyzer/c_parser/preprocessor/__init__.py" = ["F401"] # Re-exports from submodules | ||
| "c-analyzer/c_parser/preprocessor/common.py" = ["F401"] # Re-exported by preprocessor/__init__.py |
There was a problem hiding this comment.
Adding __all__ and listing the re-exports in __all__ would probably be a more idiomatic way of fixing these errors (but perhaps that's something for a followup PR, since there's a chance it could be controversial :-)
Sorry, something went wrong.
There was a problem hiding this comment.
Will open a followup for this.
Sorry, something went wrong.
|
|
||
| [lint.per-file-ignores] | ||
| "ctypes/__init__.py" = ["F401"] # Re-exports from _ctypes | ||
| "ensurepip/__init__.py" = ["F401"] # `import zlib` availability check |
There was a problem hiding this comment.
in a case like this where there's only one error, I'd usually lean towards using a noqa comment in the code rather than per-file-ignores. But, again, perhaps that's best done as a followup..
Sorry, something went wrong.
There was a problem hiding this comment.
And for this.
Sorry, something went wrong.
Keeping those linters busy man 😉 |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
| [lint] | ||
| select = [ | ||
| "F401", # Unused import | ||
| ] |
There was a problem hiding this comment.
Is it needed to repeat it? It's already in the parent (project) configuration, no?
Sorry, something went wrong.
There was a problem hiding this comment.
The parent config doesn't define a select, so defaults to ["E4", "E7", "E9", "F"].
We don't want to run the whole F category, or those other ones, so this select overwrites that one.
(There is an extend-select that is in addition to select, but we do want a smaller set here.)
Sorry, something went wrong.
There was a problem hiding this comment.
Oh sorry, I mixed Lib/.ruff.toml and .ruff.toml. You're right.
Sorry, something went wrong.
|
GH-152916 is a backport of this pull request to the 3.15 branch. |
Sorry, something went wrong.
Restore the placeholder import in idlelib/idle_test/template.py It was removed as an unused import in GH-151478, but template.py is a skeleton for creating new IDLE test files, and idle_test/README.txt instructs the user to replace 'zzdummy' with the name of the module under test. Add a Ruff per-file ignore to keep it. test_editor.RMenuTest was added in GH-18951, which fixed right-clicking inside a selection, with the note that an automated test should follow. Use the DummyRMenu class left there to test right_menu_event(), and test the rmenu_check_*() methods that supply the menu entry states. test_configdialog.ConfigDialogTest was left with two empty stubs in GH-3592, named after the two ConfigDialog methods which the button tests only check to be called. Test them with a fake parent whose instance dictionary contains an autospecced EditorWindow. test_configdialog.ExtPageTest was added empty, with a commented-out "Nothing here yet TODO" skip, when ExtPage was factored out of ConfigDialog in GH-26618. Test load_extensions(), extension_selected(), set_extension_value() and save_all_changed_extensions(). test_grep.Default_commandTest was left empty in 2013 because GrepDialog.default_command() imports OutputWindow when called, and the import cannot be moved to the top of the module due to an import loop. Replace the imported class with a mock instead of moving the import. test_config.ChangesTest.test_save_default never called save_all(), so it tested nothing. Add the missing assertions, and add the test for the Save() calls that the following TODO comment asked for. test_config.IdleConfTest.test_get_current_keyset only tested the non-darwin branch, because the default key sets no longer contain Alt keys. Add an extension binding with an Alt key, so that its replacement with Option can be tested. Remove the stale commented-out test in test_get_extension_keys, which used the ZoomHeight extension. --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: TerryJReedy <tjreedy@udel.edu>
…) (#157205) Restore the placeholder import in idlelib/idle_test/template.py It was removed as an unused import in GH-151478, but template.py is a skeleton for creating new IDLE test files, and idle_test/README.txt instructs the user to replace 'zzdummy' with the name of the module under test. Add a Ruff per-file ignore to keep it. test_editor.RMenuTest was added in GH-18951, which fixed right-clicking inside a selection, with the note that an automated test should follow. Use the DummyRMenu class left there to test right_menu_event(), and test the rmenu_check_*() methods that supply the menu entry states. test_configdialog.ConfigDialogTest was left with two empty stubs in GH-3592, named after the two ConfigDialog methods which the button tests only check to be called. Test them with a fake parent whose instance dictionary contains an autospecced EditorWindow. test_configdialog.ExtPageTest was added empty, with a commented-out "Nothing here yet TODO" skip, when ExtPage was factored out of ConfigDialog in GH-26618. Test load_extensions(), extension_selected(), set_extension_value() and save_all_changed_extensions(). test_grep.Default_commandTest was left empty in 2013 because GrepDialog.default_command() imports OutputWindow when called, and the import cannot be moved to the top of the module due to an import loop. Replace the imported class with a mock instead of moving the import. test_config.ChangesTest.test_save_default never called save_all(), so it tested nothing. Add the missing assertions, and add the test for the Save() calls that the following TODO comment asked for. test_config.IdleConfTest.test_get_current_keyset only tested the non-darwin branch, because the default key sets no longer contain Alt keys. Add an extension binding with an Alt key, so that its replacement with Option can be tested. Remove the stale commented-out test in test_get_extension_keys, which used the ZoomHeight extension. --------- (cherry picked from commit f8f8c30)
…) (#157206) Restore the placeholder import in idlelib/idle_test/template.py It was removed as an unused import in GH-151478, but template.py is a skeleton for creating new IDLE test files, and idle_test/README.txt instructs the user to replace 'zzdummy' with the name of the module under test. Add a Ruff per-file ignore to keep it. test_editor.RMenuTest was added in GH-18951, which fixed right-clicking inside a selection, with the note that an automated test should follow. Use the DummyRMenu class left there to test right_menu_event(), and test the rmenu_check_*() methods that supply the menu entry states. test_configdialog.ConfigDialogTest was left with two empty stubs in GH-3592, named after the two ConfigDialog methods which the button tests only check to be called. Test them with a fake parent whose instance dictionary contains an autospecced EditorWindow. test_configdialog.ExtPageTest was added empty, with a commented-out "Nothing here yet TODO" skip, when ExtPage was factored out of ConfigDialog in GH-26618. Test load_extensions(), extension_selected(), set_extension_value() and save_all_changed_extensions(). test_grep.Default_commandTest was left empty in 2013 because GrepDialog.default_command() imports OutputWindow when called, and the import cannot be moved to the top of the module due to an import loop. Replace the imported class with a mock instead of moving the import. test_config.ChangesTest.test_save_default never called save_all(), so it tested nothing. Add the missing assertions, and add the test for the Save() calls that the following TODO comment asked for. test_config.IdleConfTest.test_get_current_keyset only tested the non-darwin branch, because the default key sets no longer contain Alt keys. Add an extension binding with an Alt key, so that its replacement with Option can be tested. Remove the stale commented-out test in test_get_extension_keys, which used the ZoomHeight extension. --------- Co-authored-by: Claude Opus 5 (1M context) noreply@anthropic.com Co-authored-by: Hugo van Kemenade 1324225+hugovk@users.noreply.github.com Co-authored-by: TerryJReedy tjreedy@udel.edu Co-authored-by: Serhiy Storchaka storchaka@gmail.com (cherry picked from commit f8f8c30)
…) (#157204) Restore the placeholder import in idlelib/idle_test/template.py It was removed as an unused import in GH-151478, but template.py is a skeleton for creating new IDLE test files, and idle_test/README.txt instructs the user to replace 'zzdummy' with the name of the module under test. Add a Ruff per-file ignore to keep it. test_editor.RMenuTest was added in GH-18951, which fixed right-clicking inside a selection, with the note that an automated test should follow. Use the DummyRMenu class left there to test right_menu_event(), and test the rmenu_check_*() methods that supply the menu entry states. test_configdialog.ConfigDialogTest was left with two empty stubs in GH-3592, named after the two ConfigDialog methods which the button tests only check to be called. Test them with a fake parent whose instance dictionary contains an autospecced EditorWindow. test_configdialog.ExtPageTest was added empty, with a commented-out "Nothing here yet TODO" skip, when ExtPage was factored out of ConfigDialog in GH-26618. Test load_extensions(), extension_selected(), set_extension_value() and save_all_changed_extensions(). test_grep.Default_commandTest was left empty in 2013 because GrepDialog.default_command() imports OutputWindow when called, and the import cannot be moved to the top of the module due to an import loop. Replace the imported class with a mock instead of moving the import. test_config.ChangesTest.test_save_default never called save_all(), so it tested nothing. Add the missing assertions, and add the test for the Save() calls that the following TODO comment asked for. test_config.IdleConfTest.test_get_current_keyset only tested the non-darwin branch, because the default key sets no longer contain Alt keys. Add an extension binding with an Alt key, so that its replacement with Option can be tested. Remove the stale commented-out test in test_get_extension_keys, which used the ZoomHeight extension. --------- (cherry picked from commit f8f8c30)
…56260) Restore the placeholder import in idlelib/idle_test/template.py It was removed as an unused import in pythonGH-151478, but template.py is a skeleton for creating new IDLE test files, and idle_test/README.txt instructs the user to replace 'zzdummy' with the name of the module under test. Add a Ruff per-file ignore to keep it. test_editor.RMenuTest was added in pythonGH-18951, which fixed right-clicking inside a selection, with the note that an automated test should follow. Use the DummyRMenu class left there to test right_menu_event(), and test the rmenu_check_*() methods that supply the menu entry states. test_configdialog.ConfigDialogTest was left with two empty stubs in pythonGH-3592, named after the two ConfigDialog methods which the button tests only check to be called. Test them with a fake parent whose instance dictionary contains an autospecced EditorWindow. test_configdialog.ExtPageTest was added empty, with a commented-out "Nothing here yet TODO" skip, when ExtPage was factored out of ConfigDialog in pythonGH-26618. Test load_extensions(), extension_selected(), set_extension_value() and save_all_changed_extensions(). test_grep.Default_commandTest was left empty in 2013 because GrepDialog.default_command() imports OutputWindow when called, and the import cannot be moved to the top of the module due to an import loop. Replace the imported class with a mock instead of moving the import. test_config.ChangesTest.test_save_default never called save_all(), so it tested nothing. Add the missing assertions, and add the test for the Save() calls that the following TODO comment asked for. test_config.IdleConfTest.test_get_current_keyset only tested the non-darwin branch, because the default key sets no longer contain Alt keys. Add an extension binding with an Alt key, so that its replacement with Option can be tested. Remove the stale commented-out test in test_get_extension_keys, which used the ZoomHeight extension. --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: TerryJReedy <tjreedy@udel.edu>
…56260) Restore the placeholder import in idlelib/idle_test/template.py It was removed as an unused import in pythonGH-151478, but template.py is a skeleton for creating new IDLE test files, and idle_test/README.txt instructs the user to replace 'zzdummy' with the name of the module under test. Add a Ruff per-file ignore to keep it. test_editor.RMenuTest was added in pythonGH-18951, which fixed right-clicking inside a selection, with the note that an automated test should follow. Use the DummyRMenu class left there to test right_menu_event(), and test the rmenu_check_*() methods that supply the menu entry states. test_configdialog.ConfigDialogTest was left with two empty stubs in pythonGH-3592, named after the two ConfigDialog methods which the button tests only check to be called. Test them with a fake parent whose instance dictionary contains an autospecced EditorWindow. test_configdialog.ExtPageTest was added empty, with a commented-out "Nothing here yet TODO" skip, when ExtPage was factored out of ConfigDialog in pythonGH-26618. Test load_extensions(), extension_selected(), set_extension_value() and save_all_changed_extensions(). test_grep.Default_commandTest was left empty in 2013 because GrepDialog.default_command() imports OutputWindow when called, and the import cannot be moved to the top of the module due to an import loop. Replace the imported class with a mock instead of moving the import. test_config.ChangesTest.test_save_default never called save_all(), so it tested nothing. Add the missing assertions, and add the test for the Save() calls that the following TODO comment asked for. test_config.IdleConfTest.test_get_current_keyset only tested the non-darwin branch, because the default key sets no longer contain Alt keys. Add an extension binding with an Alt key, so that its replacement with Option can be tested. Remove the stale commented-out test in test_get_extension_keys, which used the ZoomHeight extension. --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: TerryJReedy <tjreedy@udel.edu>
| Back | FazBrowse Home | New Git URL |
Follow on from #151440 and #151442.
Also add Ruff F401 to help avoid this in the future, and exclude any files with false positives (rather than adding noqa comments).