Skip to content

Review mypy config #82

@ruestefa

Description

@ruestefa

Mypy is currently mostly unconfigured:

# tmpl/pyproject.toml.j2

[tool.mypy]

[[tool.mypy.overrides]]
module = [
    # Add external modules w/o type hints here
]
ignore_missing_imports = true

By contrast, in my own template (which I'm now in the process of migrating to the blueprint), it is configured comparatively extensively:

# mypy.ini

[mypy]
# --strict options (v0.941)
check_untyped_defs = True
disallow_any_generics = True
disallow_incomplete_defs = True
disallow_subclassing_any = True
# disallow_untyped_calls = True
# disallow_untyped_decorators = True
disallow_untyped_defs = True
no_implicit_optional = True
no_implicit_reexport = True
strict_equality = True
warn_redundant_casts = True
warn_return_any = True
warn_unused_configs = True
warn_unused_ignores = True

# ...

I'm not sure whether I've added this configuration after branching from the original (cookiecutter-based) blueprint, or whether it's somehow gone lost from the blueprint during refactoring and the migration to copier (though a quick look at the git history suggests the former). Either way, though, at least some of the options should be added to the default configuration provided by the blueprint. (See the docs and this blog post I've stumbled over that explains some relevant options and the need for them.)

Once I've reviewed my own mypy config, I'll post it here as a suggestion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions