MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / check_sed

Function check_sed

tools/release-set-version.py:67–75  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

65 cppcheck_version = ','.join((v+['0','0','0','0'])[:4])
66
67 def check_sed(args):
68 file = args[-1]
69 res = re.match(r's/([^/]+)/.*', args[-2])
70 if res is None:
71 raise Exception('Failed to verify sed call argument ' + args[-2])
72 pattern = res.group(1)
73 if len(egrep([pattern, file])) < 4:
74 print(f"WARNING: pattern '{pattern}' not found in file {file}")
75 sed(args)
76
77 check_sed(['-i', '-r', f's/version 2[.][0-9]+([.][0-9]+)*/version {new_version}/', 'cli/main.cpp'])
78 check_sed(['-i', '-r', f's/VERSION 2[.][0-9]+[.]99/VERSION {v3}/', 'CMakeLists.txt']) # version must have 3 parts.

Callers 1

set_versionFunction · 0.85

Calls 3

egrepFunction · 0.85
sedFunction · 0.85
matchMethod · 0.45

Tested by

no test coverage detected