Skip to content

Commit 9cdc231

Browse files
committed
Improve files uncommitted check
1 parent 390bbfc commit 9cdc231

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

python_typing_update/main.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,9 @@ async def async_check_uncommitted_changes(file_list: list[str]) -> bool:
133133
stdout=asyncio.subprocess.PIPE,
134134
)
135135
stdout, _ = await process.communicate()
136-
files_uncommitted: list[str] = [file_ for item in stdout.decode().split('\n')
137-
if (file_ := item.strip())]
138-
for file_ in file_list:
139-
for uncommited in files_uncommitted:
140-
if file_ == uncommited:
141-
return False
142-
return True
136+
files_uncommitted: set[str] = {file_ for item in stdout.decode().split('\n')
137+
if (file_ := item.strip())}
138+
return not any(True for file_ in file_list if file_ in files_uncommitted)
143139

144140

145141
async def async_check_changes(file_list: list[str]) -> list[str]:

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from python_typing_update.const import version_str
44

5-
65
with open('requirements.txt') as fp:
76
requirements = [
87
line.strip().split(' ', 1)[0] for line in fp.read().splitlines()

0 commit comments

Comments
 (0)