Skip to content

Commit 131d153

Browse files
committed
TEMP: show lines from path transformer to debug the issue with windows
1 parent f465402 commit 131d153

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

python/extractor/semmle/path_rename.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def renamer_from_options_and_env(options, logger):
2828
path_transformer = os.environ.get("CODEQL_PATH_TRANSFORMER", None) or os.environ.get("SEMMLE_PATH_TRANSFORMER", None)
2929
if path_transformer:
3030
logger.info("Using path transformer '%s'", path_transformer)
31-
rename = projectlayout.get_renamer(path_transformer)
31+
rename = projectlayout.get_renamer(path_transformer, logger)
3232
else:
3333
rename = lambda path : path
3434

python/extractor/semmle/projectlayout.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313
from functools import total_ordering
1414
import sys
1515

16-
def get_renamer(filename):
17-
layout = load(filename)
16+
def get_renamer(filename, logger):
17+
layout = load(filename, logger)
1818
def rename(path):
1919
renamed = layout.artificial_path(path)
2020
return path if renamed is None else renamed
2121
return rename
2222

23-
def load(filename):
23+
def load(filename, logger):
2424
"""Load a project-layout file from 'filename'."""
2525
with open(filename, 'rb') as f:
2626
content = f.read().decode('utf-8')
2727
lines = [ line.strip() for line in content.split('\n') ]
28-
return ProjectLayout(lines)
28+
return ProjectLayout(lines, logger)
2929

3030
def _escape_string_literal_for_regexp(literal, preserve):
3131
ESCAPE = u"(){}[].^$+\\*?"
@@ -53,7 +53,7 @@ class ProjectLayout(object):
5353
i.e. one or more paths (to include) and zero or more paths
5454
prefixed by minus-signs (to exclude)."""
5555

56-
def __init__(self, lines):
56+
def __init__(self, lines, logger):
5757
"""Construct a project-layout object from an array of strings, each
5858
corresponding to one line of the project-layout. This constructor is
5959
for testing. Usually, use the 'load' function."""
@@ -71,6 +71,7 @@ def __init__(self, lines):
7171
num = 0
7272
for line in lines:
7373
num += 1
74+
logger.info("Line %d: %s", num, line)
7475
if not line:
7576
continue
7677
if line[0] == u'@':

0 commit comments

Comments
 (0)