Skip to content

Commit ec03225

Browse files
committed
lint
1 parent 446c7c5 commit ec03225

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"scripts": {
3+
"format:json": "npx prettier --write 'data/**/*.json'"
4+
}
5+
}

scripts/normalize_book_sets.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ def normalize_book_sets(
299299
print("[DRY RUN] Would write changes to file (use --write to apply)")
300300
else:
301301
try:
302-
# Write JSON file (prettier will format it via pre-commit hook)
303302
with open(book_sets_file, "w", encoding="utf-8") as f:
304303
json.dump(data, f, ensure_ascii=False)
305304

scripts/normalize_json.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"""
44
Reads a JSON file, sorts its top-level keys numerically,
55
and writes the sorted data to a new JSON file.
6-
Prettier will format the output according to .prettierrc config.
76
87
python scripts/normalize_json.py data/leetcode-problems.json
98
"""
@@ -15,7 +14,7 @@
1514

1615
def sort_json_by_numeric_keys(input_file, output_file):
1716
"""
18-
Sort JSON file by numeric keys and format according to Prettier style.
17+
Sort JSON file by numeric keys
1918
2019
Args:
2120
input_file (str): The path to the input JSON file.
@@ -32,7 +31,6 @@ def sort_json_by_numeric_keys(input_file, output_file):
3231
sorted_items = sorted(data.items(), key=lambda item: int(item[0]))
3332
sorted_data = OrderedDict(sorted_items)
3433

35-
# Write JSON (Prettier will format it via pre-commit hook)
3634
with open(output_file, "w", encoding="utf-8") as f:
3735
json.dump(sorted_data, f, ensure_ascii=False)
3836

scripts/sort_book_sets_by_difficulty.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"""
1515

1616
import json
17-
import os
1817
import sys
1918
import argparse
2019
from pathlib import Path
@@ -183,7 +182,6 @@ def main():
183182
print(f"Dry run complete. Would update {updated_count} set(s).")
184183
else:
185184
if updated_count > 0:
186-
# Save updated book-sets.json (Prettier will format it via pre-commit hook)
187185
with open(BOOK_SETS_PATH, "w", encoding="utf-8") as f:
188186
json.dump(book_sets, f, ensure_ascii=False)
189187
print(f"✓ Updated {updated_count} book set(s) in {BOOK_SETS_PATH}")

scripts/update_problems_from_csv.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ def save_json(data):
156156
)
157157
sorted_data = OrderedDict(sorted_items)
158158

159-
# Write JSON (Prettier will format it via pre-commit hook)
160159
with open(JSON_PATH, "w", encoding="utf-8") as f:
161160
json.dump(sorted_data, f, ensure_ascii=False)
162161
return True

0 commit comments

Comments
 (0)