miss_hit icon indicating copy to clipboard operation
miss_hit copied to clipboard

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

Open flixha opened this issue 1 year ago • 1 comments

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)

flixha avatar Nov 29 '23 12:11 flixha