Add GitHub Action mypy.yml to mypy --ignore-missing-imports by cclauss · Pull Request #4274 · TheAlgorithms/Python · GitHub
Skip to content

Add GitHub Action mypy.yml to mypy --ignore-missing-imports - #4274

Closed
cclauss wants to merge 5 commits into
masterfrom
Add-GitHub-Action-mypy.yml
Closed

cclauss wants to merge 5 commits into
masterfrom
Add-GitHub-Action-mypy.yml

Conversation

@cclauss

@cclauss cclauss commented Mar 19, 2021

Copy link
Copy Markdown
Member

Describe your change:

Add testing for #4052 by running mypy --ignore-missing-imports on all directories that currently pass mypy tests.

I tried to add mypy testing to our pre-commits but #4272 was more pain than it was worth.

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?
  • Add GitHub Action mypy.yml

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

@cclauss
cclauss requested a review from dhruvmanila as a code owner March 19, 2021 09:51
@ghost ghost added awaiting reviews This PR is ready to be reviewed tests are failing Do not merge until tests pass labels Mar 19, 2021
@cclauss
cclauss requested a review from l3str4nge March 19, 2021 10:31
@cclauss cclauss changed the title Add GitHub Action mypy.yml Add GitHub Action mypy.yml to mypy --ignore-missing-imports Mar 19, 2021
@dhruvmanila

Copy link
Copy Markdown
Member

@cclauss

cclauss commented Mar 20, 2021

Copy link
Copy Markdown
Member Author

--ignore-missing-imports

@dhruvmanila

Copy link
Copy Markdown
Member

The flag --ignore-missing-imports is only for the imports whose types are missing. mypy usually complains if the type hints are missing from any imported module. This flag will make the type hint for those modules as any.

For the modules which do contain type hints, they will be used by mypy to do the validation even if this flag was passed.

@cclauss

cclauss commented Mar 20, 2021

Copy link
Copy Markdown
Member Author

@cclauss cclauss closed this Mar 20, 2021
@cclauss
cclauss deleted the Add-GitHub-Action-mypy.yml branch March 20, 2021 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviews This PR is ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants