Skip to content

Commit

Permalink
Add error handling in many locations, new SpotifyCLIException, and up…
Browse files Browse the repository at this point in the history
…date formatting and format checker (#85)
  • Loading branch information
Myoldmopar authored Dec 17, 2024
1 parent 95f3cb0 commit 0e2c7c7
Show file tree
Hide file tree
Showing 3 changed files with 180 additions and 115 deletions.
10 changes: 7 additions & 3 deletions check_format.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from os import system
from subprocess import call
import sys

files = [
"spotifycli/spotifycli.py",
Expand All @@ -10,9 +11,12 @@


def check_format():
any_failed = False
for i in files:
system(f"pycodestyle --show-source --show-pep8 --format=default {i}")
exit_code = call(["pycodestyle", "--show-source", "--show-pep8", "--format=default", i])
any_failed |= True if exit_code == 1 else False
return any_failed


if __name__ == "__main__":
check_format()
sys.exit(check_format())
3 changes: 2 additions & 1 deletion spotifycli/__main__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import sys
from .spotifycli import main
main()
sys.exit(main())
Loading

0 comments on commit 0e2c7c7

Please sign in to comment.