diff --git a/api/analyzers/analyzer.py b/api/analyzers/analyzer.py index 9e458d5..ce3f3ce 100644 --- a/api/analyzers/analyzer.py +++ b/api/analyzers/analyzer.py @@ -25,5 +25,4 @@ def second_pass(self, path: Path, f: io.TextIOWrapper) -> None: f (io.TextIOWrapper): The file handle of the file to be processed. """ - pass - + pass \ No newline at end of file diff --git a/api/analyzers/c/analyzer.py b/api/analyzers/c/analyzer.py index f5639cf..ae7ac8a 100644 --- a/api/analyzers/c/analyzer.py +++ b/api/analyzers/c/analyzer.py @@ -1,18 +1,18 @@ import io import os -from ..utils import * from pathlib import Path +import logging +import tree_sitter_c as tsc +from tree_sitter import Language, Parser, Node +from typing import Optional + +from ..utils import * from ...entities import * from ...graph import Graph -from typing import Union, Optional from ..analyzer import AbstractAnalyzer -import tree_sitter_c as tsc -from tree_sitter import Language, Parser, Node - C_LANGUAGE = Language(tsc.language()) -import logging logger = logging.getLogger('code_graph') class CAnalyzer(AbstractAnalyzer): diff --git a/api/analyzers/python/analyzer.py b/api/analyzers/python/analyzer.py index 5376139..841dc6a 100644 --- a/api/analyzers/python/analyzer.py +++ b/api/analyzers/python/analyzer.py @@ -222,10 +222,10 @@ def first_pass(self, path: Path, f: io.TextIOWrapper, graph:Graph) -> None: """ if path.suffix != '.py': - logger.debug(f"Skipping none Python file {path}") + logger.debug("Skipping none Python file %s", path) return - logger.info(f"Python Processing {path}") + logger.info("Python Processing %s", path) # Create file entity file = File(os.path.dirname(path), path.name, path.suffix) @@ -281,7 +281,7 @@ def process_function_call(self, node) -> Optional[str]: logger.warning("Unknown function call pattern") return None - logger.debug(f"callee_name: {callee_name}") + logger.debug("callee_name: %s", callee_name) return callee_name def process_call_node(self, caller: Union[Function, File], callee_name: str, diff --git a/api/entities/struct.py b/api/entities/struct.py index 37d7cad..b950e81 100644 --- a/api/entities/struct.py +++ b/api/entities/struct.py @@ -1,4 +1,5 @@ from typing import Optional +from typing import List class Struct(): """ diff --git a/tests/source_files/py/src.py b/tests/source_files/py/src.py index 8e1e19d..775b56d 100644 --- a/tests/source_files/py/src.py +++ b/tests/source_files/py/src.py @@ -1,3 +1,5 @@ +from typing import Task + def log(msg: str) -> None: print(f'msg: {msg}')