Skip to content

Update mypy presubmits for generated clients to use --strict option #2089

@parthea

Description

@parthea

Mypy has a --strict option. We should update the mypy tests for generated clients from mypy -p google to mypy -p --strict google

session.run(
'mypy',
'-p',
{% if api.naming.module_namespace %}
'{{ api.naming.module_namespace[0] }}',
{% else %}
'{{ api.naming.versioned_module_name }}',
{% endif %}
)

There is some guidance here for setting stricter options.

An excellent goal to aim for is to have your codebase pass when run against mypy --strict. This basically ensures that you will never have a type related error without an explicit circumvention somewhere (such as a # type: ignore comment).

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: cleanupAn internal cleanup or hygiene concern.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions