Skip to content

chore(ci): Enable full ruff -F (all F rules) checks and fix related errors#3672

Merged
Re-bin merged 5 commits into
HKUDS:mainfrom
yorkhellen:ci/enable-full-ruff-f
May 7, 2026
Merged

chore(ci): Enable full ruff -F (all F rules) checks and fix related errors#3672
Re-bin merged 5 commits into
HKUDS:mainfrom
yorkhellen:ci/enable-full-ruff-f

Conversation

@yorkhellen
Copy link
Copy Markdown
Contributor

Overview

  • Enable full Ruff F rule checks instead of only F401/F841 (improves code quality by catching issues at CI stage)
  • Fix all related F rule errors

Changes

  1. CI config

    • Upgrade Ruff check from --select F401,F841 to --select F
  2. Fix F821 errors

    • qq.py: Add missing import for validate_url_target
  3. Refactor logger usage

    • discord.py: Use module-level logger instead of self.logger in static methods
    • websocket.py: Use module-level logger instead of self.logger in static methods

Verification

  • ✅ Ruff checks pass for all modified files
  • ✅ Full Ruff F rule checks pass
  • ✅ 2737 tests pass (4 skipped)

PR introduced module-level logger in static methods, which drops
the channel context bound by BaseChannel.__init__. Revert to
self._channel.logger / self.logger to preserve log labels.

Also remove @staticmethod since these methods legitimately need
instance access (F821 was the real issue, not the logger source).
@chengyongru chengyongru added bug Something isn't working enhancement New feature or request CI/CD valid labels May 7, 2026
Copy link
Copy Markdown
Collaborator

@Re-bin Re-bin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ;)

@Re-bin Re-bin merged commit 536c456 into HKUDS:main May 7, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working CI/CD enhancement New feature or request valid

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants