Skip to content

Add automatically enforced type checking#222

Draft
EricPedley wants to merge 8 commits intomainfrom
eric/type-checking
Draft

Add automatically enforced type checking#222
EricPedley wants to merge 8 commits intomainfrom
eric/type-checking

Conversation

@EricPedley
Copy link
Copy Markdown
Member

@EricPedley EricPedley commented Jun 3, 2025

Description

Adds automatically enforced type checking using ty. To set up the tool everyone needs to:

  1. curl -LsSf https://astral.sh/uv/install.sh | sh
  2. uv tool install ty@latest
  3. uv tool update-shell
  4. Install the ty vscode extension by Astral
  5. Restart vscode, and if commits aren't working from the VSCode GUI because "ty: command not found", restart your entire computer
    I added settings to our .vscode that will disable the errors from Pylance so you only see the ones from ty.

ty is an experimental tool but it promises to be super fast so that's why we're trying it. It was very easy to set up for me and I haven't encountered any problems yet. Another reason I chose it was because it's made by Astral and I like the other tools they make.

Test Plan

Try committing something like a: int = 'hi' and it should stop you. Try committing actual working code and it should work like normal.

@EricPedley EricPedley requested a review from MinhxNguyen7 June 3, 2025 01:02
@EricPedley
Copy link
Copy Markdown
Member Author

Also before we merge this we gotta ping everyone on Discord to do the steps I outline in the PR to get ty installed correctly and probably also announce it to them at gen meeting.

@EricPedley EricPedley marked this pull request as draft June 3, 2025 05:09
@EricPedley
Copy link
Copy Markdown
Member Author

I'm too lazy to fix all 80 mypy errors and add the github actions integration. For anyone not following the discord thread, basically ty misses a bunch of our code so we're gonna use mypy instead of better coverage but it's super pedantic so there's a lot to fix and I don't think it's a high priority to get it working.

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.

1 participant