disnake icon indicating copy to clipboard operation
disnake copied to clipboard

style: enable more pyright rules

Open CoderJoshDK opened this issue 4 months ago • 3 comments

[!NOTE] DO NOT REVIEW THIS. This is very much WIP. Will remove this note when ready to be reviewed.

Summary

Add in reportInconsistentOverload and reportInvalidTypeVarUse pyright rules

Closes #1440

Was actually pretty quick to put this together. So it wasn't wasted work, even if you disagree with this PR.

But as stated in the issue; these overloads were not doing anything anyway. The generic should be provided in the class instead of left as an Unknown. And maybe I am misunderstanding the code. If so, please let me know why this change is wrong.

Updated the docs files because nox was complaining about deprecated usage.

These changes should all be a noop.

Checklist

  • [ ] If code changes were made, then they have been tested
    • [ ] I have updated the documentation to reflect the changes
    • [x] I have formatted the code properly by running uv run nox -s lint
    • [x] I have type-checked the code by running uv run nox -s pyright
  • [x] This PR fixes an issue
  • [ ] This PR adds something new (e.g. new method or parameters)
  • [ ] This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • [ ] This PR is not a code change (e.g. documentation, README, ...)

CoderJoshDK avatar Oct 17 '25 12:10 CoderJoshDK

Documentation build overview

📚 disnake | 🛠️ Build #29999995 | 📁 Comparing 7ef84940aceafb8724309e0fdc7030c163d727fb against latest (d9b77a78de1ace6bc38db6f6b04f2358ca952418)


🔍 Preview build

Show files changed (48 files in total): 📝 48 modified | ➕ 0 added | ➖ 0 deleted
File Status
index.html 📝 modified
whats_new.html 📝 modified
api/abc.html 📝 modified
api/activities.html 📝 modified
api/app_commands.html 📝 modified
api/app_info.html 📝 modified
api/audit_logs.html 📝 modified
api/automod.html 📝 modified
api/channels.html 📝 modified
api/clients.html 📝 modified
api/components.html 📝 modified
api/emoji.html 📝 modified
api/entitlements.html 📝 modified
api/events.html 📝 modified
api/exceptions.html 📝 modified
api/guild_scheduled_events.html 📝 modified
api/guilds.html 📝 modified
api/integrations.html 📝 modified
api/interactions.html 📝 modified
api/invites.html 📝 modified
api/localization.html 📝 modified
api/members.html 📝 modified
api/messages.html 📝 modified
api/misc.html 📝 modified
api/permissions.html 📝 modified
api/roles.html 📝 modified
api/skus.html 📝 modified
api/soundboard.html 📝 modified
api/stage_instances.html 📝 modified
api/stickers.html 📝 modified
api/subscriptions.html 📝 modified
api/ui.html 📝 modified
api/users.html 📝 modified
api/utilities.html 📝 modified
api/voice.html 📝 modified
api/webhooks.html 📝 modified
api/widgets.html 📝 modified
ext/tasks/index.html 📝 modified
ext/commands/api/app_commands.html 📝 modified
ext/commands/api/bots.html 📝 modified
ext/commands/api/checks.html 📝 modified
ext/commands/api/cogs.html 📝 modified
ext/commands/api/context.html 📝 modified
ext/commands/api/converters.html 📝 modified
ext/commands/api/exceptions.html 📝 modified
ext/commands/api/help_commands.html 📝 modified
ext/commands/api/misc.html 📝 modified
ext/commands/api/prefix_commands.html 📝 modified

@Enegg thank you for taking a look! Yea, I know a lot of things here are shifted around. This PR is not ready to be looked at anymore. Yes, there are a bunch of incorrect things in here. Will get to patching things up as they come up.

To be able to properly resolve some of the type errors, I need to resolve a bunch of Unknown situations too. So it is taking a bit of time and being a bit more complicated. Might need to lump this change in with a bigger Unknwon push. Will report back later.

CoderJoshDK avatar Oct 20 '25 00:10 CoderJoshDK

Going to wait for #1449 before I work on this more.

Also, after talking with @onerandomusername, I am going to move typing_extensions outside TYPE_CHECKING for TypeVar so we can consume the default in a much simpler way.

CoderJoshDK avatar Oct 20 '25 16:10 CoderJoshDK