Skip to content

Commit

Permalink
ruff: Apply ruff format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Javagedes committed Jan 6, 2025
1 parent c11a71b commit 4e87315
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions edk2toolext/image_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,10 @@ def execute(self, pe: PE, config_data: dict) -> Result:
if has_characteristic(
section.Characteristics, SECTION_CHARACTERISTICS["IMAGE_SCN_MEM_EXECUTE"]
) and has_characteristic(section.Characteristics, SECTION_CHARACTERISTICS["IMAGE_SCN_MEM_WRITE"]):
logging.error(f"[{Result.FAIL}]: Section [{section.Name.decode().strip()}] \
should not be both Write and Execute")
logging.error(
f"[{Result.FAIL}]: Section [{section.Name.decode().strip()}] \
should not be both Write and Execute"
)
return Result.FAIL
return Result.PASS

Expand Down Expand Up @@ -394,10 +396,12 @@ def execute(self, pe: PE, config_data: dict) -> Result:
req = alignments[0]
result = eval(f'{alignment} {req["COMPARISON"]} {req["VALUE"]}')
if result is False:
logging.error(f'[{Result.FAIL}: Section Alignment Required: \
logging.error(
f'[{Result.FAIL}: Section Alignment Required: \
[{target_info["MACHINE_TYPE"]}] \
[{target_info["PROFILE"]}]: \
[(Detected): {alignment}]')
[(Detected): {alignment}]'
)
return Result.FAIL

return Result.PASS
Expand Down

0 comments on commit 4e87315

Please sign in to comment.