Skip to content

Latest commit

 

History

History
74 lines (52 loc) · 2.3 KB

AlignMethodsRedefinitionRule.md

File metadata and controls

74 lines (52 loc) · 2.3 KB

<-- previous rule | overview | next rule -->

Align METHODS ... REDEFINITION

Aligns consecutive METHODS ... [FINAL] REDEFINITION declarations.

Activate this rule if you want to override the result of 'Align METHODS declarations' with special settings.

Options

  • Continue line after METHODS [always]
  • Continue line after method name [always]
  • Align across empty lines
  • Align across comment lines

Examples

  " comment on first group of redefinitions
  METHODS if_any_interface~medium_method_name
    REDEFINITION.
  METHODS if_any_interface~short_name
    REDEFINITION.
  METHODS if_any_interface~extra_long_method_name
    REDEFINITION.

  " comment on second group of redefinitions
  METHODS if_other_interface~any_method_name
    FINAL REDEFINITION.
  METHODS if_other_interface~other_method_name
    FINAL REDEFINITION.

  METHODS
    if_other_interface~create REDEFINITION.

  " chains are aligned independently:
  METHODS:
    if_yet_another_interface~any_method_name
      REDEFINITION,
    if_yet_another_interface~other_method_name
      REDEFINITION,
    if_yet_another_interface~create
      REDEFINITION.

Resulting code:

  " comment on first group of redefinitions
  METHODS if_any_interface~medium_method_name     REDEFINITION.
  METHODS if_any_interface~short_name             REDEFINITION.
  METHODS if_any_interface~extra_long_method_name REDEFINITION.

  " comment on second group of redefinitions
  METHODS if_other_interface~any_method_name      FINAL REDEFINITION.
  METHODS if_other_interface~other_method_name    FINAL REDEFINITION.

  METHODS if_other_interface~create               REDEFINITION.

  " chains are aligned independently:
  METHODS: if_yet_another_interface~any_method_name   REDEFINITION,
           if_yet_another_interface~other_method_name REDEFINITION,
           if_yet_another_interface~create            REDEFINITION.

Related code