Skip to content
Snippets Groups Projects
Commit b1222044 authored by Bienchen's avatar Bienchen Committed by BIOPZ-Johner Niklaus
Browse files

CMake checks

parent 03dc1317
No related branches found
No related tags found
No related merge requests found
File changed. Contains only whitespace changes. Show whitespace changes.
......@@ -20,7 +20,7 @@ class Cmake(base.FileCheck):
'''
closers = ['endmacro']
for close_stmnt in closers:
fclose_stmnt = close_stmnt + r'\((.*)\)'
fclose_stmnt = r'(?:^|\s)' + close_stmnt + r'\((.*)\)'
m_stmnt = re.match(fclose_stmnt, line)
if m_stmnt:
stmnt_id = m_stmnt.group(1)
......@@ -34,6 +34,27 @@ class Cmake(base.FileCheck):
"CMake will complain about this issue, "+
"too.\n", 15)
def CheckWhitespace(self, line):
'''
Check that there is no white space between a function call and its
opening parenthesis.
'''
openers = ['if']
for open_stmnt in openers:
fopen_stmnt = r'(?:^|\s)' + open_stmnt + r'(\s*)\('
m_stmnt = re.match(fopen_stmnt, line)
if m_stmnt:
stmnt_ws = m_stmnt.group(1)
if len(stmnt_ws):
pm3_csc.FailMsg("Line %d: " % self.current_line+
"No identifier in closing statement. The "+
"call to '%s()' should " % open_stmnt+
"go by the same name as the statement "+
"opening that block. That improves "+
"readability plus future versions of "+
"CMake will complain about this issue, "+
"too.\n", 15)
def Check(self, ignore_line_width=False):
# For now we do not have any checks for reST so this is an awkward
# dummy, just checking line width.
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment