issues
search
urbanopt
/
modelica-fmt
BSD 3-Clause "New" or "Revised" License
20
stars
6
forks
source link
Refactor/michaels notes
#4
Closed
macintoshpie
closed
4 years ago
macintoshpie
commented
4 years ago
Formatting Changes
put
constrainedby
clause on new line indented (e.g.
https://github.com/macintoshpie/modelica-buildings/blob/c2fce7cc11ed217ea7cfa9d1239ed79be8141b16/Buildings/Airflow/Multizone/MediumColumnDynamic.mo#L85
)
put if-then expressions on newlines indented (e.g.
https://github.com/macintoshpie/modelica-buildings/blob/c2fce7cc11ed217ea7cfa9d1239ed79be8141b16/Buildings/Airflow/Multizone/BaseClasses/PowerLawResistance.mo#L83
)
put function arguments (named and unnamed) on newlines indented (e.g.
https://github.com/macintoshpie/modelica-buildings/blob/format/indent-modifications/Buildings/Fluid/Actuators/Dampers/PressureIndependent.mo#L171
)
Design Changes
indentation is now tracked using a stack, allowing for the notion of "real/rendered" indentations and ignored indentations. This fixes an issue where multiple rules wanted to be indented at once, and the resulting text was overindented.
Unaddressed requests
"break very long lines" (e.g.
https://github.com/macintoshpie/modelica-buildings/blob/format/indent-modifications/Buildings/Airflow/Multizone/MediumColumn.mo#L57
)
putting vector elements on newlines (I believe this would relate to the above, as sometimes we want vectors on a single line, I think) (e.g.
https://github.com/macintoshpie/modelica-buildings/blob/format/indent-modifications/Buildings/Examples/VAVReheat/Guideline36.mo#L8
)
Formatting Changes
constrainedby
clause on new line indented (e.g. https://github.com/macintoshpie/modelica-buildings/blob/c2fce7cc11ed217ea7cfa9d1239ed79be8141b16/Buildings/Airflow/Multizone/MediumColumnDynamic.mo#L85)Design Changes
Unaddressed requests