Fixing style issues flagged by code climate.

This commit is contained in:
Jeremiah C Leary 2019-03-19 21:54:22 -05:00
parent 5e5a7b46d4
commit aebe2de87f
2 changed files with 20 additions and 17 deletions

View File

@ -60,23 +60,23 @@ def read_configuration_files(commandLineArguments):
dConfiguration = {}
for sFileName in commandLineArguments.configuration:
tempConfiguration = open_configuration_file(sFileName, commandLineArguments)
for sKey in tempConfiguration.keys():
if sKey == 'file_list':
try:
dConfiguration['file_list'].extend(tempConfiguration['file_list'])
except:
dConfiguration['file_list'] = tempConfiguration['file_list']
elif sKey == 'rule':
for sRule in tempConfiguration[sKey]:
try:
dConfiguration[sKey][sRule] = tempConfiguration[sKey][sRule]
except:
dConfiguration[sKey] = {}
dConfiguration[sKey][sRule] = tempConfiguration[sKey][sRule]
else:
dConfiguration[sKey] = tempConfiguration[sKey]
tempConfiguration = open_configuration_file(sFileName, commandLineArguments)
for sKey in tempConfiguration.keys():
if sKey == 'file_list':
try:
dConfiguration['file_list'].extend(tempConfiguration['file_list'])
except:
dConfiguration['file_list'] = tempConfiguration['file_list']
elif sKey == 'rule':
for sRule in tempConfiguration[sKey]:
try:
dConfiguration[sKey][sRule] = tempConfiguration[sKey][sRule]
except:
dConfiguration[sKey] = {}
dConfiguration[sKey][sRule] = tempConfiguration[sKey][sRule]
else:
dConfiguration[sKey] = tempConfiguration[sKey]
return dConfiguration

View File

@ -39,6 +39,7 @@ def identifier_alignment(self, iLineNumber, lGroup):
self.dFix['violations'][sViolationRange]['maximumIdentifierLength'] = iMaximumIdentifierLength
self.dFix['violations'][sViolationRange]['maximumKeywordLength'] = iMaximumKeywordLength
def find_identifier(sString):
fKeywordFound = False
@ -51,6 +52,7 @@ def find_identifier(sString):
if not sChar.isspace() and fSpaceAfterKeywordFound:
return iIndex
def add_range_violation(self, sViolationRange):
'''
Appends a range violation to the violation list if it does not already exist.
@ -64,6 +66,7 @@ def add_range_violation(self, sViolationRange):
if sViolationRange not in self.violations:
self.add_violation(sViolationRange)
def parse_keyword_identifier(sString):
lLine = sString.split()
return lLine[0], lLine[1]