Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-96738

Remove some necessary Ruff rule ignores and fix corresponding issue

    • Type: Icon: Bug Bug
    • Resolution: Declined
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Correctness
    • ALL
    • 2024-11-26

      In the previous ticket SERVER-93976, we migrated to Ruff and removed obsolete linting tools (pydocstyle, pylint, yapf). During the migration, we added multiple rule ignores in `pyproject.toml` to maintain compatibility. Now we need to:
      1. Remove unnecessary rule ignores
      2. Fix the corresponding issues in the codebase
       
      possible rules we can remove (need to do more research on this list)

      • `E712` (comparison-to-true) - Replace `== True` with `is True`
      • `F541` (f-string-without-placeholders) - Remove unnecessary f-strings
      • `F821` (undefined-name) - Fix undefined variable references
      • `F841` (unused-variable) - Remove unused variables
      • `PLR1711` (unnecessary-return) - Remove redundant returns
      • `W291` (trailing-whitespace) - Remove trailing whitespace
      • `W293` (blank-line-contains-whitespace) - Clean blank lines
      • `W605` (invalid-escape-sequence) - Fix invalid string escape sequences

            Assignee:
            juan.gu@mongodb.com Juan Gu
            Reporter:
            juan.gu@mongodb.com Juan Gu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: