Skip to content

Commit c5f47bf

Browse files
committed
remove regex modifications
1 parent e6e2c27 commit c5f47bf

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

src/codechecker_script.py

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,6 @@
2727
CODECHECKER_ENV = "{codechecker_env}"
2828
COMPILE_COMMANDS = "{compile_commands}"
2929

30-
# Note: unused
31-
START_PATH = r"\/(?:(?!\.\s+)\S)+"
32-
BAZEL_PATHS = {
33-
r"\/sandbox\/processwrapper-sandbox\/\S*\/execroot\/": "/execroot/",
34-
START_PATH + r"\/worker\/build\/[0-9a-fA-F]{16}\/root\/": "",
35-
START_PATH + r"\/[0-9a-fA-F]{32}\/execroot\/": "",
36-
# Running bazel with --spawn_strategy=processwrapper-sandbox
37-
# results in its path being wrongly replaced!
38-
# In that case the 1st then 3rd regex will match and leave the path in a
39-
# half baked state, this regex just finishes the job
40-
r"<string>bazel_codechecker\/": "<string>",
41-
}
42-
4330

4431
def fail(message, exit_code=1):
4532
""" Print error message and return exit code """
@@ -199,26 +186,6 @@ def analyze():
199186
fail("Make sure that the target can be built first")
200187

201188

202-
def fix_bazel_paths():
203-
""" Remove Bazel leading paths in all files """
204-
# Note: unused
205-
stage("Fix CodeChecker output:")
206-
folder = CODECHECKER_FILES
207-
logging.info("Fixing Bazel paths in %s", folder)
208-
counter = 0
209-
for root, _, files in os.walk(folder):
210-
for filename in files:
211-
fullpath = os.path.join(root, filename)
212-
with open(fullpath, "rt") as data_file:
213-
data = data_file.read()
214-
for pattern, replace in BAZEL_PATHS.items():
215-
data = re.sub(pattern, replace, data)
216-
with open(fullpath, "w") as data_file:
217-
data_file.write(data)
218-
counter += 1
219-
logging.info("Fixed Bazel paths in %d files", counter)
220-
221-
222189
def realpath(filename):
223190
""" Return real full absolute path for given filename """
224191
if os.path.exists(filename):
@@ -296,7 +263,6 @@ def resolve_symlinks():
296263
logging.info("Processed file paths in %d files", files_processed)
297264
def update_file_paths():
298265
""" Fix bazel sandbox paths and resolve symbolic links in generated files to real paths """
299-
#fix_bazel_paths() # this is unnecessary
300266
resolve_symlinks()
301267

302268

0 commit comments

Comments
 (0)