Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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