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

Configure mypy in workspace #156

Merged
merged 27 commits into from
Oct 11, 2023
Merged

Configure mypy in workspace #156

merged 27 commits into from
Oct 11, 2023

Conversation

DFriend01
Copy link
Contributor

@DFriend01 DFriend01 commented Jul 25, 2023

Description

  • Relevant issue: Explore VS Code Python integration #39
  • Install mypy in base container and create vscode task type check
  • The mypy extension recently had an install release. It worked in the workspace with some success, but the linter sometimes wouldn't run automatically when a file opened like the documentation said. I commented out the vscode configuration for now and settled on creating a vscode task instead.
    • [Patrick] Seems to be working now, so enabled

To Do

  • Add global launch and configuration files #154 is merged into main then main is merged into this branch
  • mypy vscode task
  • Generalize mypy vscode task (only one task)
  • mypy CI passes
    • Figure out why CI errors different from when running ament_mypy src in the terminal
  • Make mypy CI required
  • Fix mypy extension errors If still getting errors with extension, remove from devcontainer.json

Once this is merged, create a new minor release

Verification

  • Ran the vscode task and it works on multiple files (I have a lot of typing errors to fix later 😢)

@DFriend01 DFriend01 added enhancement New feature or request sim Boat Simulator team ctrl Controller team labels Jul 25, 2023
@DFriend01 DFriend01 requested a review from patrick-5546 as a code owner July 25, 2023 05:24
@DFriend01 DFriend01 self-assigned this Jul 25, 2023
@patrick-5546 patrick-5546 marked this pull request as draft August 30, 2023 23:24
Copy link
Member

@patrick-5546 patrick-5546 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Converted to draft, see To Dos in PR description

@patrick-5546 patrick-5546 added the path Pathfinding team label Aug 30, 2023
@patrick-5546
Copy link
Member

patrick-5546 commented Sep 14, 2023

I think we have to run mypy in every directory that we want inside src rather than just at src like the other linters:

  • Create a task to run for every python subdirectory of src
  • Create meta task that runs all of these tasks
  • Add meta task to lint task

@patrick-5546
Copy link
Member

@DFriend01 for reference, here is how I resolved the errors in main_launch.py

@patrick-5546 patrick-5546 removed the enhancement New feature or request label Oct 11, 2023
@patrick-5546 patrick-5546 marked this pull request as ready for review October 11, 2023 14:10
Copy link
Member

@patrick-5546 patrick-5546 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay we did it

@patrick-5546 patrick-5546 enabled auto-merge (squash) October 11, 2023 18:37
@patrick-5546 patrick-5546 merged commit 3574523 into main Oct 11, 2023
9 checks passed
@patrick-5546 patrick-5546 deleted the user/dfriend01/add-mypy branch October 11, 2023 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ctrl Controller team infrastructure path Pathfinding team sim Boat Simulator team
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants