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

refactor: use native types and f-string #2459

Merged

Conversation

jfcherng
Copy link
Contributor

@jfcherng jfcherng commented Apr 21, 2024

With from __future__ import annotations, in type annotations we can convert

  • Type =====> type
  • List =====> list
  • Tuple =====> tuple
  • Dict =====> dict
  • Set =====> set
  • Optional =====> None
  • Union =====> |

Py38 new feature(s):

  • str.format =====> f-string

Not Done in this PR

By the way, we can upgrade flake8 to v7. We previously stayed at v5 because it won't complaint about unused imports, which is used in # type: .... Or, let's go ruff as linter/formatter (this is the setup for all my Python projects now 😄 ).

@jfcherng jfcherng force-pushed the feat/future-annotations-more branch from 1d67b68 to f55722c Compare April 21, 2024 12:22
Signed-off-by: Jack Cherng <[email protected]>
boot.py Outdated Show resolved Hide resolved
boot.py Outdated Show resolved Hide resolved
boot.py Outdated Show resolved Hide resolved
jfcherng and others added 2 commits April 21, 2024 22:15
Co-authored-by: deathaxe <[email protected]>
Signed-off-by: Jack Cherng <[email protected]>
@jfcherng
Copy link
Contributor Author

jfcherng commented Apr 21, 2024

Okay, now there are only line length issues left.

@jfcherng jfcherng force-pushed the feat/future-annotations-more branch from 391562b to 3402cce Compare April 21, 2024 18:06
plugin/code_actions.py Show resolved Hide resolved
plugin/core/file_watcher.py Show resolved Hide resolved
plugin/core/settings.py Show resolved Hide resolved
plugin/core/views.py Outdated Show resolved Hide resolved
tests/server.py Show resolved Hide resolved
@predragnikolic
Copy link
Member

please ignore the failing CI, the test_did_change_before_did_close is a flaky test,
we track it here -> #2461

@predragnikolic
Copy link
Member

predragnikolic commented Apr 23, 2024

Thanks for the changes

I'll merge this tomorrow

@predragnikolic predragnikolic merged commit 0ab7616 into sublimelsp:main Apr 24, 2024
8 checks passed
@jfcherng jfcherng deleted the feat/future-annotations-more branch April 24, 2024 19:35
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.

4 participants