Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Move all mypy configuration to configuration file#987

Merged
tiangolo merged 2 commits into
fastapi:masterfrom
hukkin:rm-unused-type-ignores
Feb 27, 2020
Merged

Move all mypy configuration to configuration file#987
tiangolo merged 2 commits into
fastapi:masterfrom
hukkin:rm-unused-type-ignores

Conversation

@hukkin

@hukkin hukkin commented Feb 16, 2020

Copy link
Copy Markdown
Contributor
  • Remove unused # type: ignores
  • Make mypy complain about unused # type: ignores
  • Move all mypy configuration to configuration file (a command line flag was used in scripts/lint.sh)

@codecov

codecov Bot commented Feb 16, 2020

Copy link
Copy Markdown

Codecov Report

Merging #987 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #987   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files         294    294           
  Lines        7732   7732           
=====================================
  Hits         7732   7732

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9c3c9b6...c4c8ce2. Read the comment docs.

@hukkin

hukkin commented Feb 16, 2020

Copy link
Copy Markdown
Contributor Author

Ah, different Python versions require different # type: ignores it seems. We can either:

  • Close this PR
  • Make Travis only run mypy with one Python version (I suggest the one most commonly used by developers).

@tiangolo tiangolo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The ignores make it work in both Python 3.6 and 3.7+. And that also makes it better not to have warn_unused_ignores = True, or it would complain in one ignores for 3.6 and the others for 3.7.

But I think it's true we could have all the mypy configs in a single place instead of file and command line. Could you please remove the other changes and just leave the disallow_untyped_defs = True in the mypy.ini, and remove it from the command?

@hukkin

hukkin commented Feb 17, 2020

Copy link
Copy Markdown
Contributor Author

@tiangolo 👍 done

@hukkin hukkin changed the title Remove unused "# type: ignore"s Move all mypy configuration to configuration file Feb 24, 2020
@tiangolo tiangolo merged commit 1da8d3f into fastapi:master Feb 27, 2020
@tiangolo

Copy link
Copy Markdown
Member

Perfect, thank you! 🚀 🔧

@hukkin hukkin deleted the rm-unused-type-ignores branch November 24, 2020 23:44
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