diff --git a/lobster/tools/core/online_report.py b/lobster/tools/core/online_report.py index 0b6afdd0..24ce9dca 100755 --- a/lobster/tools/core/online_report.py +++ b/lobster/tools/core/online_report.py @@ -122,6 +122,7 @@ def main(): rel_path_from_root = os.path.relpath(item.location.filename, repo_root) + # pylint: disable=possibly-used-before-assignment actual_repo = gh_root actual_sha = options.commit actual_path = rel_path_from_root diff --git a/lobster/tools/cpp_raw/cpp_raw.py b/lobster/tools/cpp_raw/cpp_raw.py index a835be7c..de2f3511 100755 --- a/lobster/tools/cpp_raw/cpp_raw.py +++ b/lobster/tools/cpp_raw/cpp_raw.py @@ -83,14 +83,15 @@ def write_to_file(options: Namespace, data: Dict[str, Implementation]) -> None: print("Written output for %u items to %s" % (len(data), options.out)) -def find_lobster_traces(all_lines: List[str]) -> List[Tuple[re.Match, int]]: +def find_lobster_traces(all_lines: List[str]) -> List[Tuple[List[str], int]]: matches = [] i = 0 while i < len(all_lines): line = all_lines[i] - match = re.search(r'lobster-trace:\s*(\w+\.\w+)', line) + match = re.search(r'lobster-trace:\s*(.*)', line) if match: - matches.append((match, i)) + items = match.group(1).split(',') + matches.append(([item.strip() for item in items], i)) i += 1 return matches @@ -119,7 +120,7 @@ def find_all_function_decl(file_content: str) -> List[Tuple[re.Match, int]]: def create_raw_entry(data: Dict[str, Implementation], file_name: str, name: str, line_number: int) -> Tracing_Tag: - tag = Tracing_Tag("cpp", f"{file_name}::{name}::{line_number}") + tag = Tracing_Tag("cpp", f"{file_name}:{name}:{line_number}") loc = File_Reference(file_name, line_number) data[tag.key()] = Implementation( tag = tag, @@ -130,7 +131,7 @@ def create_raw_entry(data: Dict[str, Implementation], file_name: str, return tag -def create_entry(match: Tuple[re.Match, int], +def create_entry(match: Tuple[List[str], int], data: Dict[str, Implementation], all_lines: List[str], file: TextIOWrapper, tag_type: str) -> Tracing_Tag: @@ -144,11 +145,12 @@ def create_entry(match: Tuple[re.Match, int], return create_raw_entry(data, file.name, name, function_line + 1) -def create_trace_entry(match: Tuple[re.Match, int], +def create_trace_entry(match: Tuple[List[str], int], data: Dict[str, Implementation], all_lines: List[str], file: TextIOWrapper) -> None: tag = create_entry(match, data, all_lines, file, "lobster-trace") - data[tag.key()].add_tracing_target(Tracing_Tag("req", match[0].group(1))) + for req in match[0]: + data[tag.key()].add_tracing_target(Tracing_Tag("req", req)) def create_exclude_entry(match: Tuple[re.Match, int], diff --git a/lobster/tools/trlc/trlc.py b/lobster/tools/trlc/trlc.py index ef9905c2..801a411c 100644 --- a/lobster/tools/trlc/trlc.py +++ b/lobster/tools/trlc/trlc.py @@ -410,6 +410,7 @@ def main(): ok = False if ok: stab = sm.process() + # pylint: disable=possibly-used-before-assignment if not ok or stab is None: print("lobster-trlc: aborting due to earlier error") return 1