Skip to content

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

@flixha

Description

@flixha

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    tool: mh_styleAffects the style checker tool

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions