Skip to content
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

Lint and typecheck fixes #354

Merged

Conversation

null-domain
Copy link
Collaborator

@null-domain null-domain commented Oct 16, 2023

Summary

  • Various linting fixes
  • Ruff has been installed and replaces isort
  • Slotscheck has been installed to verify correct __slots__ usage
  • nox -s sphinx is no longer a default session
  • Github Actions workflows no longer run on dependabot branches, only on PRs and pushes
  • nox -s format has been renamed nox -s format_check - the format session name implied that it would format code, not check the formatting. nox -s format_fix still exists and does exactly this.
Additional but irrelevant info

You'll notice in a previous commit, pyproject.toml had a block for pyright configuration, and pyright was a default session in noxfile.py - originally I did want to migrate lightbulb to using pyright, as personally I feel it's a bit more strict with enforcing good practice (and, while biased, pyright maintainers themselves certainly seem to think so too) - not to mention that it updates and incorporates typing changes quicker than mypy does, and is in general faster with typechecking.

However, running pyright on lightbulb raises a shit ton of different errors and warnings that would take far too long to deal with. Mypy doesn't complain (which, it could be argued, isn't a great thing), so we'll stick with what works for now.

Checklist

  • I have run nox and all the pipelines have passed.

- mypy was swapped for pyright
- slotscheck has been added
- isort was swapped for ruff
- format session was renamed to format_check
- sphinx is no longer a default session
- workflows will no longer run on dependabot branches, only on the actual dependency update PR

CI improvements, more info below

- mypy was swapped for pyright
- slotscheck has been added
- isort was swapped for ruff
- format session was renamed to format_check
- sphinx is no longer a default session
- workflows will no longer run on dependabot branches, only on the actual dependency update PR
Pyright is waaaay too strict and lists way too many small errors that would take forever to fix.
Mypy at least doesn't complain (for now) so we'll stick with it.
@null-domain null-domain merged commit b189899 into tandemdude:development Oct 16, 2023
3 checks passed
@null-domain null-domain deleted the fix/linting-and-typechecking branch October 16, 2023 15:18
null-domain added a commit that referenced this pull request Dec 7, 2023
* Fix typo in docstring

* Fix custom option converter not being initialized for slash commands (#324)

* Update nox requirement from ~=2022.11.21 to ~=2023.4.22 (#318)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update hikari requirement from ~=2.0.0.dev118 to ~=2.0.0.dev119 (#322)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update sphinx requirement from ~=6.1.3 to ~=7.0.1 (#323)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update furo requirement from ~=2023.3.27 to ~=2023.5.20 (#327)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update hikari requirement from ~=2.0.0.dev119 to ~=2.0.0.dev120 (#329)

Updates the requirements on [hikari](https://github.com/hikari-py/hikari) to permit the latest version.
- [Release notes](https://github.com/hikari-py/hikari/releases)
- [Changelog](https://github.com/hikari-py/hikari/blob/master/CHANGELOG.md)
- [Commits](hikari-py/hikari@2.0.0.dev119...2.0.0.dev120)

---
updated-dependencies:
- dependency-name: hikari
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update croniter requirement from ~=1.3.14 to ~=1.4.1 (#330)

Updates the requirements on [croniter](https://github.com/kiorky/croniter) to permit the latest version.
- [Changelog](https://github.com/kiorky/croniter/blob/master/CHANGELOG.rst)
- [Commits](corpusops/croniter@1.3.14...1.4.1)

---
updated-dependencies:
- dependency-name: croniter
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update types-croniter requirement from ~=1.3.2 to ~=1.4.0 (#331)

Updates the requirements on [types-croniter](https://github.com/python/typeshed) to permit the latest version.
- [Commits](https://github.com/python/typeshed/commits)

---
updated-dependencies:
- dependency-name: types-croniter
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: thomm.o <[email protected]>

* Update furo requirement from ~=2023.5.20 to ~=2023.8.19 (#340)

Updates the requirements on [furo](https://github.com/pradyunsg/furo) to permit the latest version.
- [Release notes](https://github.com/pradyunsg/furo/releases)
- [Changelog](https://github.com/pradyunsg/furo/blob/main/docs/changelog.md)
- [Commits](pradyunsg/furo@2023.05.20...2023.08.19)

---
updated-dependencies:
- dependency-name: furo
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update sphinx requirement from ~=7.0.1 to ~=7.2.5 (#342)

Updates the requirements on [sphinx](https://github.com/sphinx-doc/sphinx) to permit the latest version.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES)
- [Commits](sphinx-doc/sphinx@v7.0.1...v7.2.5)

---
updated-dependencies:
- dependency-name: sphinx
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix mypy, improve slotting, swap dataclasses for attrs-defined classes

* Update sphinx requirement from ~=7.2.5 to ~=7.2.6 (#345)

Updates the requirements on [sphinx](https://github.com/sphinx-doc/sphinx) to permit the latest version.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES)
- [Commits](sphinx-doc/sphinx@v7.2.5...v7.2.6)

---
updated-dependencies:
- dependency-name: sphinx
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update hikari requirement from ~=2.0.0.dev120 to ~=2.0.0.dev121 (#344)

Updates the requirements on [hikari](https://github.com/hikari-py/hikari) to permit the latest version.
- [Release notes](https://github.com/hikari-py/hikari/releases)
- [Changelog](https://github.com/hikari-py/hikari/blob/master/CHANGELOG.md)
- [Commits](hikari-py/hikari@2.0.0.dev120...2.0.0.dev121)

---
updated-dependencies:
- dependency-name: hikari
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update furo requirement from ~=2023.8.19 to ~=2023.9.10 (#343)

Updates the requirements on [furo](https://github.com/pradyunsg/furo) to permit the latest version.
- [Release notes](https://github.com/pradyunsg/furo/releases)
- [Changelog](https://github.com/pradyunsg/furo/blob/main/docs/changelog.md)
- [Commits](pradyunsg/furo@2023.08.19...2023.09.10)

---
updated-dependencies:
- dependency-name: furo
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update DataStore docstring to mention an instance is attached to BotApp

* Fix documentation build (#349)

* Fix documentation build

* Remove deprecated method of specifying python version

* Actually fix doc build this time

* Ok actually for real its fixed now

* Fix localization options not being passed to subcommands or options (#325)

* Fix localization options not being passed to subcommands or options

Signed-off-by: davfsa <[email protected]>

* Remove duplicated set_name_localizations

* Black formatting fixes

* Don't call set_desc_locales on non-SlashCommandBuilder instances

---------

Signed-off-by: davfsa <[email protected]>

* Lint and typecheck fixes (#354)

* CI improvements, more info below

- slotscheck has been added
- isort was swapped for ruff
- format session was renamed to format_check
- sphinx is no longer a default session
- workflows will no longer run on dependabot branches, only on the actual dependency update PR (and pushes to other branches)

* Update ruff requirement from ~=0.0.292 to ~=0.1.0 (#355)

Updates the requirements on [ruff](https://github.com/astral-sh/ruff) to permit the latest version.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@v0.0.292...v0.1.0)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update black requirement from ~=23.9.1 to ~=23.10.0 (#356)

Updates the requirements on [black](https://github.com/psf/black) to permit the latest version.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](psf/black@23.9.1...23.10.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update croniter requirement from ~=1.4.1 to ~=2.0.1 (#353)

Updates the requirements on [croniter](https://github.com/kiorky/croniter) to permit the latest version.
- [Changelog](https://github.com/kiorky/croniter/blob/master/CHANGELOG.rst)
- [Commits](corpusops/croniter@1.4.1...2.0.1)

---
updated-dependencies:
- dependency-name: croniter
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update types-croniter requirement from ~=1.4.0 to ~=2.0.0 (#352)

Updates the requirements on [types-croniter](https://github.com/python/typeshed) to permit the latest version.
- [Commits](https://github.com/python/typeshed/commits)

---
updated-dependencies:
- dependency-name: types-croniter
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update mypy requirement from ~=1.6.0 to ~=1.6.1 (#357)

Updates the requirements on [mypy](https://github.com/python/mypy) to permit the latest version.
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](python/mypy@v1.6.0...v1.6.1)

---
updated-dependencies:
- dependency-name: mypy
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update black requirement from ~=23.10.0 to ~=23.10.1 (#359)

Updates the requirements on [black](https://github.com/psf/black) to permit the latest version.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](psf/black@23.10.0...23.10.1)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update ruff requirement from ~=0.1.0 to ~=0.1.1 (#358)

Updates the requirements on [ruff](https://github.com/astral-sh/ruff) to permit the latest version.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@v0.1.0...v0.1.1)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update ruff requirement from ~=0.1.1 to ~=0.1.3 (#361)

Updates the requirements on [ruff](https://github.com/astral-sh/ruff) to permit the latest version.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@v0.1.1...v0.1.3)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): update slotscheck requirement from ~=0.17.0 to ~=0.17.1 (#363)

Updates the requirements on [slotscheck](https://github.com/ariebovenberg/slotscheck) to permit the latest version.
- [Release notes](https://github.com/ariebovenberg/slotscheck/releases)
- [Changelog](https://github.com/ariebovenberg/slotscheck/blob/main/CHANGELOG.rst)
- [Commits](ariebovenberg/slotscheck@v0.17.0...v0.17.1)

---
updated-dependencies:
- dependency-name: slotscheck
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): update black requirement from ~=23.10.1 to ~=23.11.0 (#364)

Updates the requirements on [black](https://github.com/psf/black) to permit the latest version.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](psf/black@23.10.1...23.11.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): update hikari requirement from ~=2.0.0.dev121 to ~=2.0.0.dev122 (#368)

Updates the requirements on [hikari](https://github.com/hikari-py/hikari) to permit the latest version.
- [Release notes](https://github.com/hikari-py/hikari/releases)
- [Changelog](https://github.com/hikari-py/hikari/blob/master/CHANGELOG.md)
- [Commits](hikari-py/hikari@2.0.0.dev121...2.0.0.dev122)

---
updated-dependencies:
- dependency-name: hikari
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): update ruff requirement from ~=0.1.3 to ~=0.1.6 (#367)

Updates the requirements on [ruff](https://github.com/astral-sh/ruff) to permit the latest version.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@v0.1.3...v0.1.6)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: Case insensitive prefixes (#351)

* case insensitive prefixes

* oops

* map prefixes to str.lower

Co-authored-by: nulldomain <[email protected]>

* unpack the mapped lowercase prefixes to a tuple

technically it should work without tuple() but mypy keeps complaining and i'm honestly quite fed up of it

---------

Co-authored-by: nulldomain <[email protected]>

* chore(deps-dev): update mypy requirement from ~=1.6.1 to ~=1.7.1 (#369)

* Update mypy requirement from ~=1.6.1 to ~=1.7.1

Updates the requirements on [mypy](https://github.com/python/mypy) to permit the latest version.
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](python/mypy@v1.6.1...v1.7.1)

---
updated-dependencies:
- dependency-name: mypy
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix(mypy): ignore setting slotted attribute

i trust slotscheck more than i trust mypy

* fix: annotate partial typehint

I have absolutely no idea what parameters this type annotation takes but it looks right and mypy doesn't complain so we ball

* revert: annotate partial typehint

This reverts commit fd574dd.

* fix: ignore generic type annotation

mypy complains when functools.partial is used as a generic in python 3.11, but it's not supported in 3.8

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: nulldomain <[email protected]>

* build: allow installation in python 3.12 environments (#370)

* feat: Add Validators to Options in PrefixContext (#371)

* chore(deps-dev): update ruff requirement from ~=0.1.6 to ~=0.1.7 (#372)

Updates the requirements on [ruff](https://github.com/astral-sh/ruff) to permit the latest version.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@v0.1.6...v0.1.7)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: prepare for 2.3.4 (#373)

* docs: add changelog for v2.3.4

* chore: version bump (2.3.4)

* docs: :^)

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: davfsa <[email protected]>
Co-authored-by: thomm.o <[email protected]>
Co-authored-by: Zoey <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Oliver Thompson <[email protected]>
Co-authored-by: Luana <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants