Skip to content

Commit 10b979d

Browse files
pnhofmannpnhofmann
authored and
pnhofmann
committed
Pep8 improvements:
* Match --ignore text.sh and travis * Makefile autopep: Add line length * Format code using autopep
1 parent 0ec45d8 commit 10b979d

File tree

8 files changed

+9
-4
lines changed

8 files changed

+9
-4
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ run_docker:
88
docker run -it --rm -e DISPLAY=${DISPLAY} -v /tmp/.X11-unix:/tmp/.X11-unix jarvis:$(VERSION)
99

1010
autopep8:
11-
@find . -iname "*.py" -not -path "./env/**" | xargs autopep8 --in-place --aggressive --aggressive
11+
@find . -iname "*.py" -not -path "./env/**" | xargs autopep8 --in-place --aggressive --aggressive --max-line-length=140

installer/__main__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
except SystemExit:
2121
# Expected Error
2222
pass
23-
except:
23+
except BaseException:
2424
print("\n\n")
2525
print("An unexpected error occurred. Please open an issue on github!")
2626
print("here is the error:")

jarviscli/plugins/OpenWebsite.py

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class OpenWebsite:
2727
{Alternatively, you can also use only 'website'
2828
instead of 'open website'}
2929
"""
30+
3031
def __call__(self, jarvis, link):
3132
inputs = link.split(' ')
3233
self.main_link = inputs[0]

jarviscli/plugins/countryinfo.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def get_country(self, jarvis):
3535
else:
3636
url = "https://restcountries.eu/rest/v2/name/%s?fullText=true" % country
3737
r = requests.get(url)
38-
if type(r.json()) == dict:
38+
if isinstance(r.json(), dict):
3939
jarvis.say("Country not found.")
4040
else:
4141
return r.json()

jarviscli/plugins/dial_code.py

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class DialCode:
1616
Alias(es): phone code of
1717
dialing code of
1818
"""
19+
1920
def __call__(self, jarvis, s):
2021
# Call handle_input() function wich returns the code
2122
# (or False if no such country)
@@ -80,6 +81,7 @@ class CountryByhDC:
8081
country with dialing code
8182
countries with dialing code
8283
"""
84+
8385
def __call__(self, jarvis, s):
8486
countries = self.handle_input(s)
8587

jarviscli/plugins/google.py

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class Scraper():
1414
1515
example: google What is the Large Hadron Collider?
1616
"""
17+
1718
def __call__(self, jarvis, s):
1819
jarvis.say(self.search(s), Fore.BLUE)
1920

jarviscli/plugins/typingtest.py

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class GameState (object):
3232
class _Getch:
3333
"""Gets a single character from standard input. Does not echo to the
3434
screen."""
35+
3536
def __init__(self):
3637
self.impl = _GetchUnix()
3738

test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
source env/bin/activate
44
echo ""
55
echo "checking for linting errors"
6-
flake8 --select E,W --max-line-length=140 --ignore E722 jarviscli/ installer
6+
flake8 --select E,W --max-line-length=140 --ignore E722,W503,W504,E128 jarviscli/ installer
77
echo "lint errors checked"
88
echo ""
99
cd jarviscli/

0 commit comments

Comments
 (0)