mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-13 13:41:47 +08:00
Code improvements from new Ruff checks (#11498)
This commit is contained in:
@@ -101,7 +101,7 @@ def main() -> None:
|
||||
strict_params = _get_strict_params(path)
|
||||
print(f"\nRunning Pyright ({'stricter' if strict_params else 'base' } configs) for Python {python_version}...")
|
||||
pyright_result = subprocess.run(
|
||||
[sys.executable, "tests/pyright_test.py", path, "--pythonversion", python_version] + strict_params,
|
||||
[sys.executable, "tests/pyright_test.py", path, "--pythonversion", python_version, *strict_params],
|
||||
stderr=subprocess.PIPE,
|
||||
text=True,
|
||||
)
|
||||
|
||||
@@ -48,7 +48,7 @@ class ActionLevel(enum.IntEnum):
|
||||
try:
|
||||
return cls[cmd_arg]
|
||||
except KeyError:
|
||||
raise argparse.ArgumentTypeError(f'Argument must be one of "{list(cls.__members__)}"')
|
||||
raise argparse.ArgumentTypeError(f'Argument must be one of "{list(cls.__members__)}"') from None
|
||||
|
||||
nothing = 0, "make no changes"
|
||||
local = 1, "make changes that affect local repo"
|
||||
@@ -516,7 +516,7 @@ async def determine_action(stub_path: Path, session: aiohttp.ClientSession) -> U
|
||||
)
|
||||
|
||||
|
||||
@functools.lru_cache()
|
||||
@functools.lru_cache
|
||||
def get_origin_owner() -> str:
|
||||
output = subprocess.check_output(["git", "remote", "get-url", "origin"], text=True).strip()
|
||||
match = re.match(r"(git@github.com:|https://github.com/)(?P<owner>[^/]+)/(?P<repo>[^/\s]+)", output)
|
||||
|
||||
Reference in New Issue
Block a user