Skip to content

Commit ea92bf4

Browse files
authored
Merge b919686 into 052b56b
2 parents 052b56b + b919686 commit ea92bf4

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

.github/workflows/style-check.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Install pylint
1717
run: pip install pylint
1818
- name: Run pylint
19-
run: pylint -E generate.py
19+
run: find . -type f -name "*.py" | xargs pylint
2020
black:
2121
name: black
2222
runs-on: ubuntu-latest
@@ -46,4 +46,4 @@ jobs:
4646
- name: Install isort
4747
run: pip install isort
4848
- name: Run isort
49-
run: isort --ensure-newline-before-comments --diff generate.py
49+
run: isort --ensure-newline-before-comments --diff -v .

generate.py

+1-1
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",

leetcode_anki/helpers/leetcode.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# pylint: disable=missing-module-docstring
12
import functools
23
import json
34
import logging
@@ -230,7 +231,7 @@ def _get_problems_data(
230231
leetcode.models.graphql_question_detail.GraphqlQuestionDetail
231232
] = []
232233

233-
logging.info(f"Fetching {stop - start + 1} problems {page_size} per page")
234+
logging.info("Fetching %s problems %s per page", stop - start + 1, page_size)
234235

235236
for page in tqdm(
236237
range(math.ceil((stop - start + 1) / page_size)),
@@ -261,6 +262,8 @@ def _get_problem_data(
261262
if problem_slug in cache:
262263
return cache[problem_slug]
263264

265+
raise ValueError(f"Problem {problem_slug} is not in cache")
266+
264267
async def _get_description(self, problem_slug: str) -> str:
265268
"""
266269
Problem description

pyproject.toml

+4
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ asyncio_mode = "strict"
33
testpaths = [
44
"test",
55
]
6+
7+
[tool.pylint]
8+
max-line-length = 88
9+
disable = ["line-too-long"]

0 commit comments

Comments
 (0)