Fix issues reported by flake8-comprehensions
This commit is contained in:
parent
36f716db43
commit
29231e839d
@ -1,4 +1,5 @@
|
||||
flake8 >= 3.0.0
|
||||
flake8-comprehensions >= 1.4.1
|
||||
mock >= 1.0.1
|
||||
nose >= 1.3.7
|
||||
PyHamcrest >= 1.8.0
|
||||
|
@ -27,9 +27,8 @@ from ycm.client.event_notification import EventNotification
|
||||
from ycm.diagnostic_interface import DiagnosticInterface
|
||||
|
||||
|
||||
DIAGNOSTIC_UI_FILETYPES = set( [ 'cpp', 'cs', 'c', 'objc', 'objcpp',
|
||||
'typescript' ] )
|
||||
DIAGNOSTIC_UI_ASYNC_FILETYPES = set( [ 'java' ] )
|
||||
DIAGNOSTIC_UI_FILETYPES = { 'cpp', 'cs', 'c', 'objc', 'objcpp', 'typescript' }
|
||||
DIAGNOSTIC_UI_ASYNC_FILETYPES = { 'java' }
|
||||
|
||||
|
||||
# Emulates Vim buffer
|
||||
@ -131,8 +130,7 @@ class BufferDict( dict ):
|
||||
new_value = self[ key ] = Buffer(
|
||||
key,
|
||||
self._user_options,
|
||||
any( [ x in DIAGNOSTIC_UI_ASYNC_FILETYPES
|
||||
for x in
|
||||
vimsupport.GetBufferFiletypes( key ) ] ) )
|
||||
any( x in DIAGNOSTIC_UI_ASYNC_FILETYPES
|
||||
for x in vimsupport.GetBufferFiletypes( key ) ) )
|
||||
|
||||
return new_value
|
||||
|
@ -181,7 +181,7 @@ def _FilterToMatchingCompletions( completed_item, completions ):
|
||||
return ( ToUnicode( completed_item.get( key, "" ) ) ==
|
||||
ToUnicode( item.get( key, "" ) ) )
|
||||
|
||||
if all( [ matcher( i ) for i in match_keys ] ):
|
||||
if all( matcher( i ) for i in match_keys ):
|
||||
matched_completions.append( completion )
|
||||
return matched_completions
|
||||
|
||||
|
@ -45,20 +45,20 @@ SYNTAX_REGION_ARGUMENT_REGEX = re.compile(
|
||||
r"^(?:matchgroup|start)=.*$")
|
||||
|
||||
# See ":h syn-nextgroup".
|
||||
SYNTAX_NEXTGROUP_ARGUMENTS = set([
|
||||
SYNTAX_NEXTGROUP_ARGUMENTS = {
|
||||
'skipwhite',
|
||||
'skipnl',
|
||||
'skipempty'
|
||||
])
|
||||
}
|
||||
|
||||
# These are the parent groups from which we want to extract keywords.
|
||||
ROOT_GROUPS = set([
|
||||
ROOT_GROUPS = {
|
||||
'Boolean',
|
||||
'Identifier',
|
||||
'Statement',
|
||||
'PreProc',
|
||||
'Type'
|
||||
])
|
||||
}
|
||||
|
||||
|
||||
class SyntaxGroup( object ):
|
||||
|
@ -670,7 +670,7 @@ def CurrentFiletypesEnabled( disabled_filetypes ):
|
||||
filetypes and values are unimportant. The special key '*' matches all
|
||||
filetypes."""
|
||||
return ( '*' not in disabled_filetypes and
|
||||
not any( [ x in disabled_filetypes for x in CurrentFiletypes() ] ) )
|
||||
not any( x in disabled_filetypes for x in CurrentFiletypes() ) )
|
||||
|
||||
|
||||
def GetBufferFiletypes( bufnr ):
|
||||
|
@ -357,8 +357,8 @@ class YouCompleteMe( object ):
|
||||
|
||||
|
||||
def NativeFiletypeCompletionAvailable( self ):
|
||||
return any( [ self.FiletypeCompleterExistsForFiletype( x ) for x in
|
||||
vimsupport.CurrentFiletypes() ] )
|
||||
return any( self.FiletypeCompleterExistsForFiletype( x ) for x in
|
||||
vimsupport.CurrentFiletypes() )
|
||||
|
||||
|
||||
def NativeFiletypeCompletionUsable( self ):
|
||||
@ -498,9 +498,9 @@ class YouCompleteMe( object ):
|
||||
|
||||
|
||||
def DiagnosticUiSupportedForCurrentFiletype( self ):
|
||||
return any( [ x in DIAGNOSTIC_UI_FILETYPES or
|
||||
return any( x in DIAGNOSTIC_UI_FILETYPES or
|
||||
x in DIAGNOSTIC_UI_ASYNC_FILETYPES
|
||||
for x in vimsupport.CurrentFiletypes() ] )
|
||||
for x in vimsupport.CurrentFiletypes() )
|
||||
|
||||
|
||||
def ShouldDisplayDiagnostics( self ):
|
||||
|
Loading…
Reference in New Issue
Block a user