Skip to content
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

Support single-level indentation after opening delimiter (similar to PEP-8) #284

Open
flixha opened this issue Nov 29, 2023 · 1 comment
Labels
tool: mh_style Affects the style checker tool

Comments

@flixha
Copy link

flixha commented Nov 29, 2023

Thanks a lot for developing mh_style!

What kind of feature is this?

  • New feature in MISS_HIT

Your MATLAB/Octave environment

  • MATLAB R2021b

MISS_HIT component affected

  • Style checker

Describe the solution you'd like
It would be nice if it could support indentation style similar to PEP-8 concerning e.g., function definitions and calls, allowing to:

  • either align indented lines with the opening delimiter:
    foo = package.TopClass.long_function_name(var_one, var_two, ...
                                              var_three, var_four)
  • or, when the only phrase appearing after the opening delimiter is " ...", to continue at a single-indentation level:
    foo = package.TopClass.long_function_name( ...
        var_one, var_two, var_three, var_four)

Currently accepted style
Currently, mh_style only accepts the following styles, which doesn't help much with limiting the length of lines:

foo = package.TopClass.long_function_name( ...
                                          var_one, var_two, var_three, var_four)
foo = ...
    package.TopClass.long_function_name(var_one, var_two, ...
                                        var_three, var_four)
@florianschanda
Copy link
Owner

Sounds like an interesting idea. It's been a while since I touched the indent code so not sure how easy it'll be but I'll see what can be done.

@florianschanda florianschanda added the tool: mh_style Affects the style checker tool label Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tool: mh_style Affects the style checker tool
Projects
None yet
Development

No branches or pull requests

2 participants