fix pep8 linting errors

This commit is contained in:
Alan Hamlett 2017-10-23 22:01:31 -07:00
parent b828542a08
commit f2f9452068
6 changed files with 15 additions and 19 deletions

View File

@ -82,7 +82,7 @@ except ImportError: # pragma: nocover
if name.startswith('.'):
if not package:
raise TypeError("relative imports require the 'package' "
+ "argument")
"argument")
level = 0
for character in name:
if character != '.':

View File

@ -20,7 +20,7 @@ KEYWORDS = [
'_',
'$',
'angular',
'assert', # probably mocha
'assert', # probably mocha
'backbone',
'batman',
'c3',
@ -29,13 +29,13 @@ KEYWORDS = [
'chai',
'chaplin',
'd3',
'define', # probably require
'describe', # mocha or jasmine
'define', # probably require
'describe', # mocha or jasmine
'eco',
'ember',
'espresso',
'expect', # probably jasmine
'exports', # probably npm
'expect', # probably jasmine
'exports', # probably npm
'express',
'gulp',
'handlebars',
@ -43,8 +43,8 @@ KEYWORDS = [
'jasmine',
'jquery',
'jstz',
'ko', # probably knockout
'm', # probably mithril
'ko', # probably knockout
'm', # probably mithril
'marionette',
'meteor',
'moment',
@ -56,7 +56,7 @@ KEYWORDS = [
'qunit',
'react',
'reactive',
'require', # probably the commonjs spec
'require', # probably the commonjs spec
'ripple',
'rivets',
'socketio',

View File

@ -330,11 +330,11 @@ def process_heartbeat(args, configs, hostname, heartbeat):
if heartbeat['entity_type'] != 'file' or os.path.isfile(heartbeat['entity']):
stats = get_file_stats(heartbeat['entity'],
entity_type=heartbeat['entity_type'],
lineno=heartbeat.get('lineno'),
cursorpos=heartbeat.get('cursorpos'),
plugin=args.plugin,
language=heartbeat.get('language'))
entity_type=heartbeat['entity_type'],
lineno=heartbeat.get('lineno'),
cursorpos=heartbeat.get('cursorpos'),
plugin=args.plugin,
language=heartbeat.get('language'))
project = heartbeat.get('project') or heartbeat.get('alternate_project')
branch = None

View File

@ -112,4 +112,3 @@ class Subversion(BaseProject):
except:
pass
return False

View File

@ -40,7 +40,6 @@ class SessionCache(object):
''')
return (conn, c)
def save(self, session):
"""Saves a requests.Session object for the next heartbeat process.
"""
@ -59,7 +58,6 @@ class SessionCache(object):
except: # pragma: nocover
log.traceback(logging.DEBUG)
def get(self):
"""Returns a requests.Session object.
@ -92,7 +90,6 @@ class SessionCache(object):
return session if session is not None else requests.session()
def delete(self):
"""Clears all cached Session objects.
"""

View File

@ -102,7 +102,7 @@ def smart_guess_lexer(file_name):
if lexer1:
lexer = lexer1
if (lexer2 and accuracy2 and
(not accuracy1 or accuracy2 > accuracy1)):
(not accuracy1 or accuracy2 > accuracy1)):
lexer = lexer2
return lexer