Repository: python/typeshed

Issue:
Change `ignore_missing_stub` default to `false`?
I've been wondering about this.

Possible reasons:
1. More and more stubs are "stubtest" complete (not counting pyright and mypy)
	1.1. It should be relatively easy to "minimally complete" missing ones using stugben. Especially after the reduction of stubtest false-positives by https://github.com/python/mypy/pull/14270
	1.2. Eventually most if not all stubs will have `ignore_missing_stub = false`, which could be the only entry under `[tool.stubtest]`
2. It's easier to search for `ignore_missing_stub = true` than to search for a missing line.
3. `None` would mean `False` in the metadata parser. (feels more intuitive?)
4. #8955
    > I don't want to encourage new incomplete stubs
    
Cons:
- Have to update the metadata parser
- A commit that flips (adds/removes) the value in all metadata.toml
- Maybe wait until there's even less (if not all) "stubtest incomplete" stubs left.


Discussion:
I agree that we should change the default here. @hauntsaninja proposed doing this a while back (can't find the reference immediately), and I opposed it then. But I think I've been proven wrong since.

Resolving patch:
diff --git a/scripts/create_baseline_stubs.py b/scripts/create_baseline_stubs.py
--- a/scripts/create_baseline_stubs.py
+++ b/scripts/create_baseline_stubs.py
@@ -71,14 +71,7 @@ def create_metadata(stub_dir: str, version: str) -> None:
         return
     print(f"Writing {filename}")
     with open(filename, "w", encoding="UTF-8") as file:
-        file.write(
-            f"""\
-version = "{version}.*"
-
-[tool.stubtest]
-ignore_missing_stub = false
-"""
-        )
+        file.write(f'version = "{version}.*"')
 
 
 def add_pyright_exclusion(stub_dir: str) -> None:


Test patch:
diff --git a/tests/README.md b/tests/README.md
--- a/tests/README.md
+++ b/tests/README.md
@@ -170,16 +170,13 @@ By default, stubtest emits an error if a public object is present at runtime
 but missing from the stub. However, this behaviour can be disabled using the
 `--ignore-missing-stub` option.
 
-Many third-party stubs packages in typeshed are currently incomplete, and so by
-default, `stubtest_third_party.py` runs stubtest with the
-`--ignore-missing-stub` option to test our third-party stubs. However, this
-option is not used if the distribution has `ignore_missing_stub = false` in the
-`tool.stubtest` section of its `tests/METADATA.toml` file. This setting
-indicates that the package is considered "complete", for example:
-https://github.com/python/typeshed/blob/6950c3237065e6e2a9b64810765fec716252d52a/stubs/emoji/METADATA.toml#L3-L4
-
-You can help make typeshed's stubs more complete by adding
-`ignore_missing_stub = false` to the `tests/METADATA.toml` file for a
+If a distribution has `ignore_missing_stub = true` in the `[tool.stubtest]` section of its
+`tests/METADATA.toml` file, `stubtest_third_party.py` will test that distribution with the
+`--ignore-missing-stub option`. This indicates that the stubs for this distribution are
+considered "incomplete".
+
+You can help make typeshed's stubs more complete by removing
+`ignore_missing_stub = true` from the `tests/METADATA.toml` file for a
 third-party stubs distribution, running stubtest, and then adding things that
 stubtest reports to be missing to the stub. However, note that not *everything*
 that stubtest reports to be missing should necessarily be added to the stub.
diff --git a/tests/parse_metadata.py b/tests/parse_metadata.py
--- a/tests/parse_metadata.py
+++ b/tests/parse_metadata.py
@@ -67,7 +67,7 @@ def read_stubtest_settings(distribution: str) -> StubtestSettings:
     brew_dependencies = data.get("brew_dependencies", [])
     choco_dependencies = data.get("choco_dependencies", [])
     extras = data.get("extras", [])
-    ignore_missing_stub = data.get("ignore_missing_stub", True)
+    ignore_missing_stub = data.get("ignore_missing_stub", False)
     specified_platforms = data.get("platforms", ["linux"])
 
     assert type(skipped) is bool