feat: ✨ Add slotscheck to ensure __slots__ are used correctly#42
Open
Paillat-dev wants to merge 12 commits intomasterfrom
Open
feat: ✨ Add slotscheck to ensure __slots__ are used correctly#42Paillat-dev wants to merge 12 commits intomasterfrom
slotscheck to ensure __slots__ are used correctly#42Paillat-dev wants to merge 12 commits intomasterfrom
Conversation
There was a problem hiding this comment.
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
slotscheckas 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements https://github.com/ariebovenberg/slotscheck to ensure
__slots__are used correctly, and fix some incorrect__slots__usages.