All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.delphi.rules.community-delphi.VisibilityKeywordIndentation.html Maven / Gradle / Ivy

The newest version!

Why is this an issue?

Visibility specifier directives (private, public, etc.) should use the same indentation as the type name that they are declared under. This allows developers to easily differentiate between fields, routines, and properties of different visibilities.

Please note that this rule checks for an exact match on leading whitespace - mixed indentation may yield unexpected results.

How to fix it

Indent the visibility specifier at the same level as the enclosing type declaration:

  type
    TFoo = class(TObject)
      private
      procedure Bar;
      public
      public constructor Create;
    end;
  type
    TFoo = class(TObject)
    private
      procedure Bar;
    public
      constructor Create;
    end;

Resources





© 2015 - 2024 Weber Informatics LLC | Privacy Policy