refactor(common): make utils imports local

This commit is contained in:
Anthony Berg 2025-07-23 12:10:37 +02:00
parent 8783be2d32
commit 0d9d47136d

View File

@ -1,11 +1,9 @@
import re
from pathlib import Path
def get_project_root() -> Path:
"""
Gets the root directory of the project.
"""
from pathlib import Path
return Path(__file__).parent.parent.parent
@ -21,6 +19,8 @@ def get_includes(file: str, local: bool = False) -> list[str]:
Returns:
A list of the includes (without ``#include ""``) from the given string.
"""
import re
pattern = '^\\W*#include\\W+(.+?)\\W*$'
if local:
pattern = '^\\W*#include\\s+"(.+?)"\\W*$'