From 6e32710a08e98336a33f4a09771e60e99367bdac Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Thu, 28 Nov 2024 12:19:31 +0200 Subject: [PATCH 1/3] clean lint errors --- api/entities/struct.py | 1 + dist/code_graph_backend-0.1.0.tar.gz | Bin 0 -> 74 bytes tests/source_files/py/src.py | 2 ++ 3 files changed, 3 insertions(+) create mode 100644 dist/code_graph_backend-0.1.0.tar.gz 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/dist/code_graph_backend-0.1.0.tar.gz b/dist/code_graph_backend-0.1.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..9c390a7cdd3e3b52270c95b1c6272bc678970170 GIT binary patch literal 74 zcmb2|=HOre0;d1T`6;RK=|zbJ8SzPp$=RuSDY^!FhI$5iC5c50Zx1r^0#zMa@ZCR` W&wK$$2N*P%GtaswtInXozyJUulM~Va literal 0 HcmV?d00001 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}') From 14fa021df528c442bd083846b2815e4cba96267d Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Thu, 28 Nov 2024 12:20:11 +0200 Subject: [PATCH 2/3] clean lint errors --- dist/code_graph_backend-0.1.0.tar.gz | Bin 74 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 dist/code_graph_backend-0.1.0.tar.gz diff --git a/dist/code_graph_backend-0.1.0.tar.gz b/dist/code_graph_backend-0.1.0.tar.gz deleted file mode 100644 index 9c390a7cdd3e3b52270c95b1c6272bc678970170..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 74 zcmb2|=HOre0;d1T`6;RK=|zbJ8SzPp$=RuSDY^!FhI$5iC5c50Zx1r^0#zMa@ZCR` W&wK$$2N*P%GtaswtInXozyJUulM~Va From aee708a5222e5b9bc3382038e4556eec5417c13d Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Thu, 28 Nov 2024 12:33:32 +0200 Subject: [PATCH 3/3] clean lint --- api/analyzers/analyzer.py | 3 +-- api/analyzers/c/analyzer.py | 12 ++++++------ api/analyzers/python/analyzer.py | 6 +++--- 3 files changed, 10 insertions(+), 11 deletions(-) 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,