From aebe2de87f01c169ecf06489dac4e882e95faef6 Mon Sep 17 00:00:00 2001 From: Jeremiah C Leary Date: Tue, 19 Mar 2019 21:54:22 -0500 Subject: [PATCH] Fixing style issues flagged by code climate. --- vsg/__main__.py | 34 +++++++++++++++---------------- vsg/check/identifier_alignment.py | 3 +++ 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/vsg/__main__.py b/vsg/__main__.py index 28702014..5620b420 100644 --- a/vsg/__main__.py +++ b/vsg/__main__.py @@ -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 diff --git a/vsg/check/identifier_alignment.py b/vsg/check/identifier_alignment.py index aafc8aec..e56eba34 100644 --- a/vsg/check/identifier_alignment.py +++ b/vsg/check/identifier_alignment.py @@ -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]