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 name.startswith('.'):
if not package: if not package:
raise TypeError("relative imports require the 'package' " raise TypeError("relative imports require the 'package' "
+ "argument") "argument")
level = 0 level = 0
for character in name: for character in name:
if character != '.': if character != '.':

View file

@ -20,7 +20,7 @@ KEYWORDS = [
'_', '_',
'$', '$',
'angular', 'angular',
'assert', # probably mocha 'assert', # probably mocha
'backbone', 'backbone',
'batman', 'batman',
'c3', 'c3',
@ -29,13 +29,13 @@ KEYWORDS = [
'chai', 'chai',
'chaplin', 'chaplin',
'd3', 'd3',
'define', # probably require 'define', # probably require
'describe', # mocha or jasmine 'describe', # mocha or jasmine
'eco', 'eco',
'ember', 'ember',
'espresso', 'espresso',
'expect', # probably jasmine 'expect', # probably jasmine
'exports', # probably npm 'exports', # probably npm
'express', 'express',
'gulp', 'gulp',
'handlebars', 'handlebars',
@ -43,8 +43,8 @@ KEYWORDS = [
'jasmine', 'jasmine',
'jquery', 'jquery',
'jstz', 'jstz',
'ko', # probably knockout 'ko', # probably knockout
'm', # probably mithril 'm', # probably mithril
'marionette', 'marionette',
'meteor', 'meteor',
'moment', 'moment',
@ -56,7 +56,7 @@ KEYWORDS = [
'qunit', 'qunit',
'react', 'react',
'reactive', 'reactive',
'require', # probably the commonjs spec 'require', # probably the commonjs spec
'ripple', 'ripple',
'rivets', 'rivets',
'socketio', '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']): if heartbeat['entity_type'] != 'file' or os.path.isfile(heartbeat['entity']):
stats = get_file_stats(heartbeat['entity'], stats = get_file_stats(heartbeat['entity'],
entity_type=heartbeat['entity_type'], entity_type=heartbeat['entity_type'],
lineno=heartbeat.get('lineno'), lineno=heartbeat.get('lineno'),
cursorpos=heartbeat.get('cursorpos'), cursorpos=heartbeat.get('cursorpos'),
plugin=args.plugin, plugin=args.plugin,
language=heartbeat.get('language')) language=heartbeat.get('language'))
project = heartbeat.get('project') or heartbeat.get('alternate_project') project = heartbeat.get('project') or heartbeat.get('alternate_project')
branch = None branch = None

View file

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

View file

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

View file

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