-
Notifications
You must be signed in to change notification settings - Fork 10
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
Convert to GNU Octave code style #116
Comments
Open question: for multiple LHS variables in an assignment like |
I did a rough draft bulk conversion for this on branch "WIP/swift-style". It addresses most of the items noted in the description, except for converting the generic This is a multi-commit WIP work stream, and will be rebased and squashed before merging. |
I merged those style changes from the "rough draft" plus a couple others to |
Octave style guide re-read notes"It is customary to prefix the error message with the name of the function that generated it." But it doesn't mention using an actual error or warning identifier (the separate arg). "For functions that are not present in Matlab, favor the use of underscores. For example, base64_decode, common_size, or compare_versions." I'm using Under Naming, outside "Function names" it says "Do not use mixed case (a.k.a. CamelCase) names." It doesn't mention class naming at all. "Always use double quotes for strings and characters rather than the Matlab single quote convention." Except for strings containing double quotes or backslashes. "Enclose the condition of an if, while, until, or switch statement in parentheses, as in C", but not for "The negation operator is written with a space between the operator and its target, e.g., ! A." Oops! I'm not doing this. "Comments that start with a double sharp-sign, ##, are stand-alone comments that occupy an entire line." They use this even for one-line comments; those are still considered "block comments". I'm not doing this. Things they don't cover
|
Did some more style changes on the
I'm a little tired; don't think I'll get to those soon. |
I'm going to postpone doing the |
Let's convert Tablicious fully over to Octave's conventional code style.
endif
/endfor
/endfunction
/endxxx
instead of plainend
.!
instead of~
for negation.()
aroundif
,while
, andswitch
predicates.#
for comments (#
for inline comments,##
for block comments).end_try_catch
, just bc that looks gross to me.Open questions:
[a,b,c] = ...
assignments have spaces after commas like[a, b, c] = ...
?Don't care about Matlab compatibility here, because there's not much use case for running Tablicious code under Matlab at all.
It's fine to do code-style-only commits or PRs for this. And IMHO preferable: I'd rather get this all over with at once and have the whole Tablicious code base in consistent Octave style.
But wait until pr0m1th3as is done with this PR work before modifying
table.m
.TODO
.editorconfig
with supporting settings, including trailing whitespace stripping.References
The text was updated successfully, but these errors were encountered: