SchemaStore/schemastore

Mypy missing `disable_bytearray_promotion`, `disable_memoryview_promotion`, and `enable_incomplete_feature`

Closed this issue · 1 comments

Area with issue?

JSON Schema

✔️ Expected Behavior

I was expecting that the disable_bytearray_promotion, disable_memoryview_promotion, and enable_incomplete_feature be included in the JSON schema.

Here's a link to where the two disable_* options mentioned in the code.

These two are easy, since they're just booleans.

Here's a link to where enable_incomplete_feature is mentioned in the code.
It is also mentioned in the blog post for the Mypy 1.11 release, under "Support Python 3.12 Syntax for Generics (PEP 695)".

This one is an array of specific strings, so this might be trickier depending on how specific you want to be about what the valid values for the array are. For example, Mypy v1.11 has the incomplete features NewGenericSyntax and PreciseTupleTypes, whereas the previous version (v1.10.1) only has PreciseTupleTypes, and the latest version (as of this writing) if installed directly from GitHub includes InlineTypedDict, NewGenericSyntax, and PreciseTupleTypes.

For context, I came to this issue by using the Even Better TOML extension in VS Code, which makes use of JSON schemas for various TOML files.

I would be willing to open a PR for this it looks like there are a lot of test files (good thing!) for various scenarios and I have not contributed any fixes to this project before, so I'm not immediately sure of what would need to be added, updated, and so forth. Updating the partial-mypy.json file seems like it would be straightforward enough, though!

I marked this as being related to Visual Studio Code but I don't think editor matters here too much.

❌ Actual Behavior

These properties were flagged as not allowed, since they're missing in the schema definition.

YAML or JSON file that does not work.

{
  "tool": {
    "mypy": {
      "disable_bytearray_promotion": true,
      "disable_memoryview_promotion": true,
      "enable_incomplete_feature": [
        "NewGenericSyntax",
        "PreciseTupleTypes"
      ]
    }
  }
}

IDE or code editor.

Visual Studio Code

Are you making a PR for this?

No, someone else must create the PR.

Thank you!