Skip to content

Commit

Permalink
Add flake8 check to Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
timgraham committed Dec 16, 2016
1 parent b13d6fc commit 092836c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ python:
services:
- memcached
install: python setup.py install
before_script: pip install nose
script: nosetests
before_script: pip install -r test-requirements.txt
script:
- flake8
- nosetests
10 changes: 5 additions & 5 deletions memcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
from __future__ import print_function

import binascii
import os
import re
import socket
import sys
Expand Down Expand Up @@ -366,7 +365,7 @@ def get_slab_stats(self):
break
item = line.split(' ', 2)
if line.startswith('STAT active_slabs') or line.startswith('STAT total_malloced'):
serverData[item[1]]=item[2]
serverData[item[1]] = item[2]
else:
# 0 = STAT, 1 = ITEM, 2 = Value
slab = item[1].split(':', 2)
Expand Down Expand Up @@ -777,7 +776,8 @@ def cas(self, key, val, time=0, min_compress_len=0, noreply=False):
return self._set("cas", key, val, time, min_compress_len, noreply)

def _map_and_prefix_keys(self, key_iterable, key_prefix):
"""Compute the mapping of server (_Host instance) -> list of keys to
"""
Compute the mapping of server (_Host instance) -> list of keys to
stuff onto that server, as well as the mapping of prefixed key
-> original key.
"""
Expand Down Expand Up @@ -979,7 +979,7 @@ def _val_to_store_info(self, val, min_compress_len):
val = val.encode('ascii')
# force no attempt to compress this silly string.
min_compress_len = 0
elif six.PY2 and isinstance(val, long):
elif six.PY2 and isinstance(val, long): # noqa: F821
flags |= Client._FLAG_LONG
val = str(val)
if six.PY3:
Expand Down Expand Up @@ -1277,7 +1277,7 @@ def _recv_value(self, server, flags, rlen):
if six.PY3:
val = int(buf)
else:
val = long(buf)
val = long(buf) # noqa: F821
elif flags & Client._FLAG_PICKLE:
try:
file = BytesIO(buf)
Expand Down
4 changes: 4 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@ release = 1
packager = Sean Reifschneider <[email protected]>
requires = python-memcached

[flake8]
exclude = build
max-line-length = 119

[wheel]
universal = 1

0 comments on commit 092836c

Please sign in to comment.