lynxthecat / cake-autorate

Eliminate the excess latency and jitter terrorizing your 4G, 5G, LTE, Starlink or other variable rate connection!
https://www.bufferbloat.net
GNU General Public License v2.0
263 stars 24 forks source link

Add an Octave formatter and make our script compliant with formatter #281

Closed rany2 closed 4 months ago

rany2 commented 4 months ago

Add Octave formatting script

Modified from matlab-formatter-vscode to add GNU Octave support and to adapt it to cake-autorate's needs (i.e., I added some features like inplace, tabs, argparse, etc.).

Further, I fixed in which a line like: if ...'LOAD', 'REFLECTOR'}) % {'DEBUG', 'INFO', 'SJHAPER'} would break the formatter in addition to other more subtle issues.

It is based on https://github.com/affenwiesel/matlab-formatter-vscode commit 43d7224.

For reference on what needs to be modified, see https://en.wikibooks.org/wiki/MATLAB_Programming/Differences_between_Octave_and_MATLAB

[Octave] Avoid end and use endif/endwhile consistently

In some parts of the script, there is some usage of end. It doesn't really matter but I prefer for the script to be more consistent.

rany2 commented 4 months ago

NOTE: I didn't reformat the Octave script, @moeller0 could do that on his end whenever he feels like. I don't want to break any branches on his end as he's the primary developer of this. It's just nice to have the option to reformat if we ever needed to.