commit bd7ffe28f7dfff27d14447be1493fdf59b98a809
parent 616bf3fc9a0e537c3c3d9fd5d823a872d623edcb
Author: Andrew Laack <andrew@laack.co>
Date: Fri, 4 Jul 2025 11:57:04 -0500
Added formatting step to commits
Diffstat:
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/leetcode-submission.sh b/leetcode-submission.sh
@@ -7,6 +7,7 @@ output=$(python3 ~/bin/python-files/create-leetcode.py "$1" "$2") && \
echo "$output" | xargs vim && \
dirname=$(echo "$output" | cut -d'/' -f1) && \
formatted_name=$(echo "$dirname" | tr '-' ' ') && \
+black .
git add . && \
git commit -m "Completed $formatted_name" && \
git push
diff --git a/python-files/create-leetcode.py b/python-files/create-leetcode.py
@@ -62,6 +62,10 @@ if __name__ == "__main__":
try:
problem_name = parse_url(sys.argv[1])
file_extension = sys.argv[2]
+
+ if file_extension == "":
+ raise ValueError(f'Please specify the file extension from the cli.')
+
except IndexError as e:
raise ValueError(f'Please specify the filename and file extension from the cli: {e}')