Skip to content

Commit

Permalink
Exporter Formatting Fix (#1081)
Browse files Browse the repository at this point in the history
  • Loading branch information
HunterBarclay authored Aug 9, 2024
2 parents bba71ac + 191c8cf commit 62e088c
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import adsk.core
import adsk.fusion

from proto.proto_out import assembly_pb2, joint_pb2, material_pb2, types_pb2

from ...Logging import logFailure, timed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import adsk.core
import adsk.fusion

from proto.proto_out import joint_pb2, types_pb2

from ...general_imports import *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

import adsk.core
import adsk.fusion

from proto.proto_out import assembly_pb2, joint_pb2, motor_pb2, signal_pb2, types_pb2

from ...general_imports import *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import traceback

import adsk

from proto.proto_out import material_pb2

from ...general_imports import *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import adsk.core
import adsk.fusion
from google.protobuf.json_format import MessageToJson

from proto.proto_out import assembly_pb2, types_pb2

from ...APS.APS import getAuth, upload_mirabuf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from typing import Union

import adsk

from proto.proto_out import types_pb2

from ...general_imports import INTERNAL_ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import adsk.core
import adsk.fusion

from proto.proto_out import assembly_pb2

from ...Logging import logFailure
Expand Down
13 changes: 10 additions & 3 deletions exporter/SynthesisFusionAddin/tools/verifyIsortFormatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,16 @@ def main() -> None:
exitCode = 0
for i, (oldFileState, newFileState) in enumerate(zip(oldFileStates, newFileStates)):
for j, (previousLine, newLine) in enumerate(zip(oldFileState, newFileState)):
if previousLine != newLine:
print(f"File {files[i]} is not formatted correctly!\nLine: {j + 1}")
exitCode = 1
if previousLine == newLine:
continue

print(f"File {files[i]} is not formatted correctly!\nLine: {j + 1}")
oldFileStateRange = range(max(0, j - 10), min(len(oldFileState), j + 11))
print("\nOld file state:\n" + "\n".join(oldFileState[k].strip() for k in oldFileStateRange))
newFileStateRange = range(max(0, j - 10), min(len(newFileState), j + 11))
print("\nNew file state:\n" + "\n".join(newFileState[k].strip() for k in newFileStateRange))
exitCode = 1
break

if not exitCode:
print("All files are formatted correctly with isort!")
Expand Down

0 comments on commit 62e088c

Please sign in to comment.