Skip to content

Commit 7c61689

Browse files
committed
Resolve merge conflicts - keep version without Prettier calls
1 parent ec03225 commit 7c61689

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

scripts/normalize_book_sets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ 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)
302303
with open(book_sets_file, "w", encoding="utf-8") as f:
303304
json.dump(data, f, ensure_ascii=False)
304305

scripts/normalize_json.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
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.
67
78
python scripts/normalize_json.py data/leetcode-problems.json
89
"""
@@ -14,7 +15,7 @@
1415

1516
def sort_json_by_numeric_keys(input_file, output_file):
1617
"""
17-
Sort JSON file by numeric keys
18+
Sort JSON file by numeric keys and format according to Prettier style.
1819
1920
Args:
2021
input_file (str): The path to the input JSON file.
@@ -31,6 +32,7 @@ def sort_json_by_numeric_keys(input_file, output_file):
3132
sorted_items = sorted(data.items(), key=lambda item: int(item[0]))
3233
sorted_data = OrderedDict(sorted_items)
3334

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

scripts/sort_book_sets_by_difficulty.py

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

1616
import json
17+
import os
1718
import sys
1819
import argparse
1920
from pathlib import Path
@@ -182,6 +183,7 @@ def main():
182183
print(f"Dry run complete. Would update {updated_count} set(s).")
183184
else:
184185
if updated_count > 0:
186+
# Save updated book-sets.json (Prettier will format it via pre-commit hook)
185187
with open(BOOK_SETS_PATH, "w", encoding="utf-8") as f:
186188
json.dump(book_sets, f, ensure_ascii=False)
187189
print(f"✓ Updated {updated_count} book set(s) in {BOOK_SETS_PATH}")

scripts/update_problems_from_csv.py

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

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

0 commit comments

Comments
 (0)