Skip to content

Commit

Permalink
rebase and address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kumarak committed Nov 16, 2023
1 parent c4c55c1 commit 40daf19
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/blight/actions/embed_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@

from blight.action import CompilerAction
from blight.enums import Lang
from blight.tool import Tool
from blight.tool import CompilerTool
from blight.util import flock_append


def cc_as_string(tool_record: Dict):
def cc_as_string(tool_record: Dict) -> str:
return json.dumps(tool_record).replace('"', '\\"').replace("\\\\", "\\")


def add_to_envp(envp: Dict, key: str, value):
def add_to_envp(envp: Dict, key: str, value) -> None:

Check failure on line 27 in src/blight/actions/embed_commands.py

View workflow job for this annotation

GitHub Actions / Trunk Check

mypy(no-untyped-def)

[new] Function is missing a type annotation for one or more arguments
if isinstance(value, str):
envp[key] = value.replace('"', "'")
elif isinstance(value, list):
Expand All @@ -33,15 +33,15 @@ def add_to_envp(envp: Dict, key: str, value):
envp[key] = value


def is_input_assembly(tool: Tool):
def is_input_assembly(tool: CompilerTool) -> bool:
for file_path in tool.inputs:
file_path_str = str(file_path)
if file_path_str.endswith(".S") or file_path_str.endswith(".s"):
return True
return False


def cc_as_dict(tool: Tool) -> Dict:
def cc_as_dict(tool: CompilerTool) -> Dict:
env = {}

Check failure on line 45 in src/blight/actions/embed_commands.py

View workflow job for this annotation

GitHub Actions / Trunk Check

mypy(var-annotated)

[new] Need type annotation for "env" (hint: "env: Dict[<type>, <type>] = ...")
tool_dict = tool.asdict()
old_env = tool_dict["env"]
Expand Down Expand Up @@ -117,4 +117,4 @@ def before_run(self, tool: CompilerTool) -> None:
"-Wno-overlength-strings",
"-Wno-error",
"-Wno-unknown-escape-sequence",
]
]

0 comments on commit 40daf19

Please sign in to comment.