Ensure all comments in the codebase provide value and clarity rather than creating confusion. Remove comments that are:
In test files, be particularly cautious with comments that could be misinterpreted about what’s being tested. For example, avoid trailing comments that might suggest a different behavior than what the test is actually checking.
Example of problematic comments:
# pylint: disable=unused-import # Not helpful if not using pylint
foo.__dict__.get("not__annotations__") # RUF061 # Misleading - suggests this should trigger a warning
Example of improved approach:
# Cases that should NOT trigger the violation
foo.__dict__.get("not__annotations__")
Regularly review and clean up comments when code changes make them obsolete. Comments should enhance understanding, not create confusion.
Enter the URL of a public GitHub repository