mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-24 04:58:59 -05:00
Merge branch 'master' into feature/loadingscreen-refactor
This commit is contained in:
@@ -321,9 +321,22 @@ def check_line_length(lines):
|
||||
|
||||
|
||||
|
||||
def check_empty_character_at_end(lines):
|
||||
# Disable this check in non-strict mode
|
||||
if not is_strict_mode:
|
||||
return ''
|
||||
|
||||
index = [i + 1 for i, s in enumerate(lines) if len(s) > 1 and s[-2] == ' ']
|
||||
if len(index) > 0:
|
||||
return index
|
||||
else:
|
||||
return ''
|
||||
|
||||
|
||||
|
||||
previousSymbols = {}
|
||||
def check_header_file(file, component):
|
||||
with open(file, 'r+') as f:
|
||||
with open(file, 'r+', encoding="utf8") as f:
|
||||
lines = f.readlines()
|
||||
|
||||
correctness = check_correctness(lines)
|
||||
@@ -405,10 +418,13 @@ def check_header_file(file, component):
|
||||
if line_length:
|
||||
print(file, '\t', 'Line length exceeded: ', line_length)
|
||||
|
||||
empty_character_at_end = check_empty_character_at_end(lines)
|
||||
if empty_character_at_end:
|
||||
print(file, '\t', 'Empty character at end: ', empty_character_at_end)
|
||||
|
||||
|
||||
def check_inline_file(file, component):
|
||||
with open(file, 'r+') as f:
|
||||
with open(file, 'r+', encoding="utf8") as f:
|
||||
lines = f.readlines()
|
||||
|
||||
copyright = check_copyright(lines)
|
||||
@@ -451,10 +467,14 @@ def check_inline_file(file, component):
|
||||
if line_length:
|
||||
print(file, '\t', 'Line length exceeded: ', line_length)
|
||||
|
||||
empty_character_at_end = check_empty_character_at_end(lines)
|
||||
if empty_character_at_end:
|
||||
print(file, '\t', 'Empty character at end: ', empty_character_at_end)
|
||||
|
||||
|
||||
|
||||
def check_source_file(file, component):
|
||||
with open(file, 'r+') as f:
|
||||
with open(file, 'r+', encoding="utf8") as f:
|
||||
lines = f.readlines()
|
||||
|
||||
header = check_glm_header(lines, file)
|
||||
@@ -486,6 +506,10 @@ def check_source_file(file, component):
|
||||
if line_length:
|
||||
print(file, '\t', 'Line length exceeded: ', line_length)
|
||||
|
||||
empty_character_at_end = check_empty_character_at_end(lines)
|
||||
if empty_character_at_end:
|
||||
print(file, '\t', 'Empty character at end: ', empty_character_at_end)
|
||||
|
||||
|
||||
|
||||
def check_files(positiveList, negativeList, component, check_function):
|
||||
|
||||
Reference in New Issue
Block a user