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

Remove MyPy ignore directive #187

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

DimitriPapadopoulos
Copy link
Contributor

No description provided.

@DimitriPapadopoulos DimitriPapadopoulos changed the title Precise MyPy ignore directives Remove MyPy ignore directive Aug 7, 2024
@DimitriPapadopoulos DimitriPapadopoulos marked this pull request as ready for review August 7, 2024 11:47
@abravalheri
Copy link
Owner

Thank you @DimitriPapadopoulos.

Do you know if there is an automatic way of removing directives previously needed by mypy? It could be integrated into the CI...

@abravalheri abravalheri merged commit 88f9376 into abravalheri:main Aug 7, 2024
1 of 15 checks passed
@DimitriPapadopoulos
Copy link
Contributor Author

As a starting point, I suggest some of these Repo-Review suggestions (that's where this PR comes from). I can prepare a PR.

I have no experience with mypy-upgrade.

@abravalheri
Copy link
Owner

As a starting point, I suggest some of these Repo-Review suggestions (that's where this PR comes from). I can prepare a PR.

I think some of these are fine, but others might too much for this repo (like prettier or custom pre-commit message).

Does mypy-upgrade can get rid of type: ignore comments that become obsolete with newer versions of mypy?

@DimitriPapadopoulos
Copy link
Contributor Author

DimitriPapadopoulos commented Aug 7, 2024

I think some of these are fine, but others might too much for this repo (like prettier or custom pre-commit message).

I was thinking of the settings related to MyPy only, and then only those that aren't too invasive. See #191.

Does mypy-upgrade can get rid of type: ignore comments that become obsolete with newer versions of mypy?

Yes, according to Features (but again I don't have any experience with it):

  • Removal of unused type: ignore comments
  • Replacement of blanket type: ignore comments with error code-specific comments
  • Support for suppressing multiple mypy errors per-line
  • Preservation of existing in-line comments
  • Optional inclusion of mypy error description messages
  • Selective suppression of type errors by file, directory, package, module, or mypy error codes

@DimitriPapadopoulos
Copy link
Contributor Author

Actually, I wonder whether repo-review uses mypy-upgrade internally, or if they share a common base. Indeed, they report the exact same issues.

@henryiii
Copy link
Collaborator

henryiii commented Aug 7, 2024

sp-repo-review only looks at configuration files. Generally repo-review plugins are recommended to process configuration files, and aren't encouraged to look at source files. (The WebAssembly version has to fetch each file, so limiting access is encouraged).

@DimitriPapadopoulos
Copy link
Contributor Author

Indeed, I got it all mixed up. I meant that the MyPy changes suggested by repo-review end up in the same suggestions as mypy-update. So the additional MyPy options seem equivalent to mypy-update.

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.

3 participants