Skip to content

Commit 60589da

Browse files
committed
Fix formatting
1 parent 1790db6 commit 60589da

File tree

2 files changed

+9
-21
lines changed

2 files changed

+9
-21
lines changed

generate.py

+4-11
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def parse_args() -> argparse.Namespace:
3434
"--start", type=int, help="Start generation from this problem", default=0
3535
)
3636
parser.add_argument(
37-
"--stop", type=int, help="Stop generation on this problem", default=2**64
37+
"--stop", type=int, help="Stop generation on this problem", default=2 ** 64
3838
)
3939
parser.add_argument(
4040
"--page-size",
@@ -49,10 +49,7 @@ def parse_args() -> argparse.Namespace:
4949
default="",
5050
)
5151
parser.add_argument(
52-
"--output-file",
53-
type=str,
54-
help="Output filename",
55-
default=OUTPUT_FILE,
52+
"--output-file", type=str, help="Output filename", default=OUTPUT_FILE
5653
)
5754

5855
args = parser.parse_args()
@@ -173,7 +170,7 @@ async def generate(
173170
</a>
174171
<br/>
175172
""",
176-
},
173+
}
177174
],
178175
)
179176
leetcode_deck = genanki.Deck(LEETCODE_ANKI_DECK_ID, Path(output_file).stem)
@@ -189,11 +186,7 @@ async def generate(
189186
logging.info("Generating flashcards")
190187
for leetcode_task_handle in task_handles:
191188
note_generators.append(
192-
generate_anki_note(
193-
leetcode_data,
194-
leetcode_model,
195-
leetcode_task_handle,
196-
)
189+
generate_anki_note(leetcode_data, leetcode_model, leetcode_task_handle)
197190
)
198191

199192
for leetcode_note in tqdm(note_generators, unit="flashcard"):

test/helpers/test_leetcode.py

+5-10
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
username="testcontributor",
3737
profile_url="test://profile/url",
3838
avatar_url="test://avatar/url",
39-
),
39+
)
4040
],
4141
lang_to_valid_playground="{}",
4242
topic_tags=[
@@ -53,10 +53,8 @@
5353
hints=["test hint 1", "test hint 2"],
5454
solution=[
5555
leetcode.models.graphql_question_solution.GraphqlQuestionSolution(
56-
id=1,
57-
can_see_detail=False,
58-
typename="test type name",
59-
),
56+
id=1, can_see_detail=False, typename="test type name"
57+
)
6058
],
6159
status="ac",
6260
sample_test_case="test case",
@@ -273,17 +271,14 @@ async def test_get_problem_data(self) -> None:
273271
async def test_get_problems_data_page(self) -> None:
274272
data = leetcode.models.graphql_data.GraphqlData(
275273
problemset_question_list=leetcode.models.graphql_problemset_question_list.GraphqlProblemsetQuestionList(
276-
questions=[
277-
QUESTION_DETAIL,
278-
],
279-
total_num=1,
274+
questions=[QUESTION_DETAIL], total_num=1
280275
)
281276
)
282277
response = leetcode.models.graphql_response.GraphqlResponse(data=data)
283278
self._leetcode_data._api_instance.graphql_post.return_value = response
284279

285280
assert self._leetcode_data._get_problems_data_page(0, 10, 0) == [
286-
QUESTION_DETAIL,
281+
QUESTION_DETAIL
287282
]
288283

289284
@pytest.mark.asyncio

0 commit comments

Comments
 (0)