mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Code improvements from new Ruff checks (#11498)
This commit is contained in:
@@ -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