Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mypy_config documentation is confusing #94

Open
whitphx opened this issue Jan 17, 2022 · 2 comments
Open

mypy_config documentation is confusing #94

whitphx opened this issue Jan 17, 2022 · 2 comments

Comments

@whitphx
Copy link

whitphx commented Jan 17, 2022

The mypy_config field accepts a string as below.

- case: foo
  mypy_config:
    python_version = 3.8

So, if we want to provide multi fields, it would be like below, where the value of mypy_config in the YAML format is of type str.

- case: foo
  mypy_config: |
    python_version = 3.8
    ignore_missing_imports = True

However, the document says its type is Optional[Dict[str, Union[str, int, bool, float]]]={} which I think means the following YAML format (dict syntax) is accepted.

- case: foo
  mypy_config:
    python_version: 3.8
    ignore_missing_imports: true

but actually it is not.


My suggestion is either

  • to change the documentation to say the type of mypy_config is str, or
  • to change the implementation to accept the YAML dict.

because the files field, which is documented to accept Optional[List[File]]=[] type, can be specified with the YAML list syntax like

    - path: myapp/__init__.py

, which is inconsistent and confusing.


The same problem is there on the env field.
Its type is documented as Optional[Dict[str, str]]={}, but the YAML syntax for the field is list as follows:

  env:
    - MYPYPATH=./pytest_mypy_plugins/tests/fixtures
@sobolevn
Copy link
Member

Let's change it to be str, this is more flexible.
Do you want to work on this? 🙂

@whitphx
Copy link
Author

whitphx commented Jan 18, 2022

Thank you, but no. Please do it on your side 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants