Permalink
Browse files

Update flake8 config

  • Loading branch information...
1 parent 285c452 commit edd2bdbe0f4f763c7bb09011bb1810217e1a6e82 @puremourning puremourning committed Mar 6, 2016
View
@@ -127,7 +127,7 @@ def NewCandidateInsertionText( to_insert, text_after_cursor ):
if isinstance( candidate, dict ):
new_candidate = candidate.copy()
- if not 'abbr' in new_candidate:
+ if 'abbr' not in new_candidate:
new_candidate[ 'abbr' ] = new_candidate[ 'word' ]
new_candidate[ 'word' ] = NewCandidateInsertionText(
@@ -44,6 +44,7 @@
class BaseRequest( object ):
+
def __init__( self ):
pass
@@ -212,6 +213,7 @@ def _BuildUri( handler ):
SERVER_HEALTHY = False
+
def _CheckServerIsHealthyWithCache():
global SERVER_HEALTHY
@@ -29,6 +29,7 @@
HandleServerException )
from ycmd.responses import ServerError
+
class CompleterAvailableRequest( BaseRequest ):
def __init__( self, filetypes ):
super( CompleterAvailableRequest, self ).__init__()
@@ -29,6 +29,7 @@
from .. import completion_request
+
class ConvertCompletionResponseToVimDatas_test( object ):
""" This class tests the
completion_request._ConvertCompletionResponseToVimDatas method """
@@ -177,7 +177,8 @@ def _GetKeptAndNewSigns( placed_signs, buffer_number_to_line_to_diags,
next_sign_id ):
new_signs = []
kept_signs = []
- for buffer_number, line_to_diags in iteritems( buffer_number_to_line_to_diags ):
+ for buffer_number, line_to_diags in iteritems(
+ buffer_number_to_line_to_diags ):
if not vimsupport.BufferIsVisible( buffer_number ):
continue
@@ -253,8 +254,9 @@ def ClampToOne( value ):
return diag
-class _DiagSignPlacement( namedtuple( "_DiagSignPlacement",
- [ 'id', 'line', 'buffer', 'is_error' ] ) ):
+class _DiagSignPlacement(
+ namedtuple( "_DiagSignPlacement",
+ [ 'id', 'line', 'buffer', 'is_error' ] ) ):
# We want two signs that have different ids but the same location to compare
# equal. ID doesn't matter.
def __eq__( self, other ):
@@ -33,6 +33,7 @@
OMNIFUNC_NOT_LIST = ( 'Omnifunc did not return a list or a dict with a "words" '
' list when expected.' )
+
class OmniCompleter( Completer ):
def __init__( self, user_options ):
super( OmniCompleter, self ).__init__( user_options )
@@ -222,5 +222,3 @@ def _ExtractKeywordsFromGroup( group ):
word = word[ :-1 ]
keywords.append( word )
return keywords
-
-
@@ -1 +0,0 @@
-
@@ -107,8 +107,7 @@ def AdjustCandidateInsertionText_MultipleStrings_test():
eq_( [ { 'abbr': 'foobar', 'word': 'foo' },
{ 'abbr': 'zobar', 'word': 'zo' },
{ 'abbr': 'qbar', 'word': 'q' },
- { 'abbr': 'bar', 'word': '' },
- ],
+ { 'abbr': 'bar', 'word': '' }, ],
base.AdjustCandidateInsertionText( [ 'foobar',
'zobar',
'qbar',
@@ -269,4 +268,3 @@ def CurrentIdentifierFinished_WhitespaceOnly_test():
with MockCurrentColumnAndLineContents( 3, '\t\t\t\t' ):
ok_( base.CurrentIdentifierFinished() )
-
@@ -417,4 +417,3 @@ def _Check_FileReadyToParse_Diagnostic_Clean( self, vim_command ):
] )
eq_( self.server_state.GetErrorCount(), 0 )
eq_( self.server_state.GetWarningCount(), 0 )
-
@@ -37,7 +37,7 @@ def BuildOmnicompletionRequest( results ):
request = OmniCompletionRequest( omni_completer, None )
request.Start()
- return request;
+ return request
def Done_AlwaysTrue_test():
@@ -199,18 +199,19 @@ def FilterToCompletedCompletions_OldVim_NonMatchIsntReturned_test( self,
@patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
@patch( 'ycm.vimsupport.TextBeforeCursor', return_value = " Te" )
- def HasCompletionsThatCouldBeCompletedWithMoreText_OldVim_MatchIsReturned_test(
+ def HasCompletionsThatCouldBeCompletedWithMoreText_OldVim_MatchIsReturned_test( # noqa
self, *args ):
completions = [ BuildCompletion( "Test" ) ]
- result = self.ycm._HasCompletionsThatCouldBeCompletedWithMoreText( completions )
+ result = self.ycm._HasCompletionsThatCouldBeCompletedWithMoreText(
+ completions )
eq_( result, True )
@patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
@patch( 'ycm.vimsupport.TextBeforeCursor', return_value = "X" )
- def HasCompletionsThatCouldBeCompletedWithMoreText_OldVim_ShortTextDoesntRaise_test(
+ def HasCompletionsThatCouldBeCompletedWithMoreText_OldVim_ShortTextDoesntRaise_test( # noqa
self, *args ):
completions = [ BuildCompletion( "AAA" ) ]
@@ -219,22 +220,24 @@ def HasCompletionsThatCouldBeCompletedWithMoreText_OldVim_ShortTextDoesntRaise_t
@patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
@patch( 'ycm.vimsupport.TextBeforeCursor', return_value = "Test" )
- def HasCompletionsThatCouldBeCompletedWithMoreText_OldVim_ExactMatchIsntReturned_test(
+ def HasCompletionsThatCouldBeCompletedWithMoreText_OldVim_ExactMatchIsntReturned_test( # noqa
self, *args ):
completions = [ BuildCompletion( "Test" ) ]
- result = self.ycm._HasCompletionsThatCouldBeCompletedWithMoreText( completions )
+ result = self.ycm._HasCompletionsThatCouldBeCompletedWithMoreText(
+ completions )
eq_( result, False )
@patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
@patch( 'ycm.vimsupport.TextBeforeCursor', return_value = " Quote" )
- def HasCompletionsThatCouldBeCompletedWithMoreText_OldVim_NonMatchIsntReturned_test(
+ def HasCompletionsThatCouldBeCompletedWithMoreText_OldVim_NonMatchIsntReturned_test( # noqa
self, *args ):
completions = [ BuildCompletion( "A" ) ]
- result = self.ycm._HasCompletionsThatCouldBeCompletedWithMoreText( completions )
+ result = self.ycm._HasCompletionsThatCouldBeCompletedWithMoreText(
+ completions )
eq_( result, False )
@@ -243,11 +246,12 @@ def HasCompletionsThatCouldBeCompletedWithMoreText_OldVim_NonMatchIsntReturned_t
@patch( 'ycm.vimsupport.GetVariableValue',
GetVariableValue_CompleteItemIs( "Te") )
@patch( 'ycm.vimsupport.TextBeforeCursor', return_value = " Quote" )
- def HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_MatchIsReturned_test(
+ def HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_MatchIsReturned_test( # noqa
self, *args ):
completions = [ BuildCompletion( "Test" ) ]
- result = self.ycm._HasCompletionsThatCouldBeCompletedWithMoreText( completions )
+ result = self.ycm._HasCompletionsThatCouldBeCompletedWithMoreText(
+ completions )
eq_( result, True )
@@ -256,7 +260,7 @@ def HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_MatchIsReturned_test(
@patch( 'ycm.vimsupport.GetVariableValue',
GetVariableValue_CompleteItemIs( "X") )
@patch( 'ycm.vimsupport.TextBeforeCursor', return_value = " Quote" )
- def HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_ShortTextDoesntRaise_test(
+ def HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_ShortTextDoesntRaise_test( # noqa
self, *args ):
completions = [ BuildCompletion( "AAA" ) ]
@@ -267,11 +271,12 @@ def HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_ShortTextDoesntRaise_t
@patch( 'ycm.vimsupport.GetVariableValue',
GetVariableValue_CompleteItemIs( "Test" ) )
@patch( 'ycm.vimsupport.TextBeforeCursor', return_value = ' Quote' )
- def HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_ExactMatchIsntReturned_test(
+ def HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_ExactMatchIsntReturned_test( # noqa
self, *args ):
completions = [ BuildCompletion( "Test" ) ]
- result = self.ycm._HasCompletionsThatCouldBeCompletedWithMoreText( completions )
+ result = self.ycm._HasCompletionsThatCouldBeCompletedWithMoreText(
+ completions )
eq_( result, False )
@@ -280,11 +285,12 @@ def HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_ExactMatchIsntReturned
@patch( 'ycm.vimsupport.GetVariableValue',
GetVariableValue_CompleteItemIs( " Quote" ) )
@patch( 'ycm.vimsupport.TextBeforeCursor', return_value = ' Quote' )
- def HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_NonMatchIsntReturned_test(
+ def HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_NonMatchIsntReturned_test( # noqa
self, *args ):
completions = [ BuildCompletion( "A" ) ]
- result = self.ycm._HasCompletionsThatCouldBeCompletedWithMoreText( completions )
+ result = self.ycm._HasCompletionsThatCouldBeCompletedWithMoreText(
+ completions )
eq_( result, False )
@@ -309,7 +315,7 @@ def GetCompletionsUserMayHaveCompleted_ReturnEmptyIfNotDone_test( self ):
eq_( [], self.ycm.GetCompletionsUserMayHaveCompleted() )
- def GetCompletionsUserMayHaveCompleted_ReturnEmptyIfPendingMatches_NewVim_test(
+ def GetCompletionsUserMayHaveCompleted_ReturnEmptyIfPendingMatches_NewVim_test( # noqa
self ):
completions = [ BuildCompletion( None ) ]
with self._SetupForCsharpCompletionDone( completions ):
@@ -319,7 +325,7 @@ def GetCompletionsUserMayHaveCompleted_ReturnEmptyIfPendingMatches_NewVim_test(
eq_( [], self.ycm.GetCompletionsUserMayHaveCompleted() )
- def GetCompletionsUserMayHaveCompleted_ReturnEmptyIfPendingMatches_OldVim_test(
+ def GetCompletionsUserMayHaveCompleted_ReturnEmptyIfPendingMatches_OldVim_test( # noqa
self, *args ):
completions = [ BuildCompletion( None ) ]
with self._SetupForCsharpCompletionDone( completions ):
@@ -340,7 +346,7 @@ def GetCompletionsUserMayHaveCompleted_ReturnMatchIfExactMatches_NewVim_test(
eq_( completions, self.ycm.GetCompletionsUserMayHaveCompleted() )
- def GetCompletionsUserMayHaveCompleted_ReturnMatchIfExactMatchesEvenIfPartial_NewVim_test(
+ def GetCompletionsUserMayHaveCompleted_ReturnMatchIfExactMatchesEvenIfPartial_NewVim_test( # noqa
self, *args ):
info = [ "NS", "Test", "Abbr", "Menu", "Info", "Kind" ]
completions = [ BuildCompletion( *info ),
@@ -353,7 +359,7 @@ def GetCompletionsUserMayHaveCompleted_ReturnMatchIfExactMatchesEvenIfPartial_Ne
self.ycm.GetCompletionsUserMayHaveCompleted() )
- def GetCompletionsUserMayHaveCompleted_DontReturnMatchIfNontExactMatchesAndPartial_NewVim_test(
+ def GetCompletionsUserMayHaveCompleted_DontReturnMatchIfNontExactMatchesAndPartial_NewVim_test( # noqa
self ):
info = [ "NS", "Test", "Abbr", "Menu", "Info", "Kind" ]
completions = [ BuildCompletion( insertion_text = info[ 0 ] ),
@@ -391,7 +397,7 @@ def PostCompleteCsharp_EmptyDoesntInsertNamespace_test( self, *args ):
ok_( not vimsupport.InsertNamespace.called )
- def PostCompleteCsharp_ExistingWithoutNamespaceDoesntInsertNamespace_test(
+ def PostCompleteCsharp_ExistingWithoutNamespaceDoesntInsertNamespace_test(
self, *args ):
completions = [ BuildCompletion( None ) ]
with self._SetupForCsharpCompletionDone( completions ):
Oops, something went wrong.

0 comments on commit edd2bdb

Please sign in to comment.