-
Notifications
You must be signed in to change notification settings - Fork 1
feat: ✨ Add slotscheck
to ensure __slots__
are used correctly
#42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR integrates slotscheck
to validate proper usage of __slots__
in the py-cord library. The tool helps ensure that __slots__
declarations are correct and consistent across the codebase.
- Adds
slotscheck
as a development dependency and CI check - Fixes incorrect
__slots__
declarations by removing redundant or inherited attributes - Adds missing
__slots__
declarations for mixin classes
Reviewed Changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
pyproject.toml | Adds slotscheck as a development dependency |
.pre-commit-config.yaml | Configures slotscheck as a pre-commit hook |
.github/workflows/lib-checks.yml | Adds slotscheck to CI pipeline |
discord/widget.py | Removes inherited attributes from WidgetMember.slots |
discord/sticker.py | Removes _state and url attributes from slots declarations |
discord/raw_models.py | Adds empty slots to _RawReprMixin base class |
discord/partial_emoji.py | Removes _state from PartialEmoji.slots |
discord/emoji.py | Removes inherited attributes from BaseEmoji.slots |
discord/components.py | Removes inherited type attribute from InputText.slots |
discord/asset.py | Adds slots to AssetMixin and removes _state from Asset.slots |
discord/activity.py | Removes _created_at from Activity.slots |
Comments suppressed due to low confidence (1)
.pre-commit-config.yaml:37
- The version v0.19.1 for slotscheck should be verified to exist. Based on the pyproject.toml dependency specification of '>=0.19.1', this appears to be the minimum required version, but it's important to confirm this version actually exists in the repository.
rev: v0.19.1
Documentation build overview
Show files changed (10 files in total): 📝 10 modified | ➕ 0 added | ➖ 0 deleted
|
…12.11 (#93) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Implements https://github.com/ariebovenberg/slotscheck to ensure
__slots__
are used correctly, and fix some incorrect__slots__
usages.