Skip to content

Remove MyPy ignore directive#187

Merged
abravalheri merged 1 commit into
abravalheri:mainfrom
DimitriPapadopoulos:mypy
Aug 7, 2024
Merged

Remove MyPy ignore directive#187
abravalheri merged 1 commit into
abravalheri:mainfrom
DimitriPapadopoulos:mypy

Conversation

@DimitriPapadopoulos

Copy link
Copy Markdown
Contributor

No description provided.

@DimitriPapadopoulos DimitriPapadopoulos force-pushed the mypy branch 3 times, most recently from 92e2f35 to 89562bd Compare August 7, 2024 09:41
@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
Copy Markdown
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
@DimitriPapadopoulos DimitriPapadopoulos deleted the mypy branch August 7, 2024 14:32
@DimitriPapadopoulos

Copy link
Copy Markdown
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
Copy Markdown
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

DimitriPapadopoulos commented Aug 7, 2024

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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

henryiii commented Aug 7, 2024

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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