-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non univocal formatting for certain lines #114
Comments
It looks like a bug in the |
Btw, def main():
parser = argparse.ArgumentParser(
prog="matlab_parser",
description="Parser of matlab code",
)
parser.add_argument("--startLine", type=int, default=1)
parser.add_argument("--endLine", type=int, default=None)
parser.add_argument("--indentWidth", type=int, default=4)
parser.add_argument("--separateBlocks", type=bool, default=True)
parser.add_argument("--indentMode", type=str, default="all_functions")
parser.add_argument("--addSpaces", type=str, default="exclude_pow")
parser.add_argument("--matrixIndent", type=str, default="aligned")
parser.add_argument("filename", type=str)
args = parser.parse_args()
indentModes = dict(all_functions=1, only_nested_functions=-1, classic=0)
operatorSpaces = dict(all_operators=1, exclude_pow=0.5, no_spaces=0)
matrixIndentation = dict(aligned=1, simple=0)
indent: int = args.indentWidth
start: int = args.startLine
end: int = args.endLine
sep: bool = args.separateBlocks
mode: int = indentModes.get(args.indentMode)
opSp: float = operatorSpaces.get(args.addSpaces)
matInd: int = matrixIndentation.get(args.matrixIndent)
formatter = Formatter(indent, sep, mode, opSp, matInd)
formatter.formatFile(args.filename, start, end) |
LoZack19
changed the title
Non univocal formattation for certain lines
Non univocal formatting for certain lines
Sep 7, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This line:
Formats into this line:
Which formats in this line:
Observe the spacing in the last parenthesis. I think that this behavior is unintended.
The text was updated successfully, but these errors were encountered: