Skip to content

Commit b60b2bb

Browse files
committed
Added flake8 to CI
1 parent 4b1323b commit b60b2bb

File tree

11 files changed

+20
-12
lines changed

11 files changed

+20
-12
lines changed

.flake8

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
exclude = build/*
3+
per-file-ignores =
4+
obswebsocket/requests.py: E501 W391 W293
5+
obswebsocket/events.py: E501 W391 W293

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
language: python
22
python:
33
- '2.7'
4-
- '3.5'
4+
- '3.6'
55
install:
66
- pip install -r ci-requirements.txt
77
- pip install -v .
88
script:
99
- pytest
10+
- flake8

ci-requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
six
1+
-r requirements.txt
22
pytest
3-
websocket-client
3+
flake8

generate_classes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55
import json
66
from six.moves.urllib.request import urlopen
77

8-
import_url = "https://raw.githubusercontent.com/Palakis/obs-websocket/4.x-current/docs/generated/comments.json"
8+
import_url = "https://raw.githubusercontent.com/Palakis/obs-websocket/4.x-current/docs/generated/comments.json" # noqa: E501
9+
910

1011
def clean_var(string):
1112
"""
1213
Converts a string to a suitable variable name by removing not allowed
1314
characters.
1415
"""
1516
for ch in ['-', '.', '*']:
16-
string = string.replace(ch, '_')
17+
string = string.replace(ch, '_')
1718
string = string.replace('[]', '')
1819
return string
1920

obswebsocket/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
Python library to communicate with an obs-websocket server.
66
"""
77

8-
from .core import obsws
8+
from .core import obsws # noqa: F401

obswebsocket/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def _auth(self, password):
115115

116116
if result['status'] != 'ok':
117117
raise exceptions.ConnectionFailure(result['error'])
118-
118+
119119
if result.get('authRequired'):
120120
secret = base64.b64encode(
121121
hashlib.sha256(
@@ -270,7 +270,7 @@ def register(self, callback, trigger):
270270
def unregister(self, callback, trigger):
271271
for c, t in self.functions:
272272
if (c == callback) and (trigger is None or t == trigger):
273-
self.functions.remove((c, t))
273+
self.functions.remove((c, t))
274274

275275
def trigger(self, data):
276276
for callback, trigger in self.functions:

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
six
2+
websocket-client

samples/events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
logging.basicConfig(level=logging.INFO)
99

1010
sys.path.append('../')
11-
from obswebsocket import obsws, events
11+
from obswebsocket import obsws, events # noqa: E402
1212

1313
host = "localhost"
1414
port = 4444

samples/switch_scenes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
logging.basicConfig(level=logging.INFO)
99

1010
sys.path.append('../')
11-
from obswebsocket import obsws, requests
11+
from obswebsocket import obsws, requests # noqa: E402
1212

1313

1414
host = "localhost"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
description = open('README.md', 'r').read()
1414
import pypandoc
1515
description = pypandoc.convert_text(description, 'rst', 'markdown_github')
16-
except:
16+
except ImportError:
1717
pass
1818
# If not possible, leave it in Markdown...
1919

0 commit comments

Comments
 (0)