Mach: introduce Pyrefly for Python type checking, starting with the wpt folder (#37953)

This is the first stage of adopting Pyrefly. It introduces the Python
folder and focuses on fixing issues around it.

Testing: *Describe how this pull request is tested or why it doesn't
require tests*
Fixes: *Link to an issue this pull requests fixes or remove this line if
there is no issue*

---------

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
This commit is contained in:
Jerens Lensun 2025-07-11 21:07:36 +08:00 committed by GitHub
parent 2366a8bf9e
commit 55fd7b862f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 303 additions and 154 deletions

View file

@ -7,6 +7,7 @@
# option. This file may not be copied, modified, or distributed
# except according to those terms.
from argparse import ArgumentParser
import os
import sys
@ -25,7 +26,7 @@ import localpaths # noqa: F401,E402
import wptrunner.wptcommandline # noqa: E402
def create_parser():
def create_parser() -> ArgumentParser:
parser = wptrunner.wptcommandline.create_parser()
parser.add_argument(
"--rr-chaos", default=False, action="store_true", help="Run under chaos mode in rr until a failure is captured"
@ -60,5 +61,5 @@ def create_parser():
return parser
def run_tests():
def run_tests() -> bool:
return test.run_tests()