Statement Indentation Must Match Block Nesting
WarningClean ABAP & Modern SyntaxQuickFix Ready#EC BAD_INDENTRemote Enabled
Overview
Bad Statement Indentation.
ATC Finding Message:
Statement indentation does not match block nesting
Rationale
Indentation is the fastest visual cue for block nesting, so inconsistent indentation misleads readers about which statements belong together. It also creates noisy diffs when a formatter runs. Indent each block level consistently.
Non-Compliant
abap
METHOD calculate.
DATA lv_total TYPE i.
LOOP AT lt_items INTO ls_item.
lv_total = lv_total + ls_item-amount.
ENDLOOP.
ENDMETHOD.Compliant
abap
METHOD calculate.
DATA lv_total TYPE i.
LOOP AT lt_items INTO ls_item.
lv_total = lv_total + ls_item-amount.
ENDLOOP.
ENDMETHOD.Automated QuickFix
This rule provides an automated QuickFix directly in Eclipse ABAP Development Tools (ADT):
- Position the cursor on the flagged statement.
- Press Ctrl + 1 (Quick Assist).
- Select the automated refactoring to apply the clean syntax immediately.
Configuration & Thresholds
This check can be fine-tuned directly in the ATC Check Variant Editor (CHKV) in Eclipse ADT:
| Parameter Name | Data Type | Default Value |
|---|---|---|
INDENT_STEP | Integer | 2 |
Suppression
To suppress findings for this rule, append the pseudo-comment to the statement:
abap
" Standard pseudo-comment:
... "#EC BAD_INDENT
" SAP CI_ prefix format:
... "#EC CI_BAD_INDENTTechnical Details
- Native ATC Class:
ZCL_SKYLINT_NO_BAD_INDENT - Implementation File: zcl_skylint_no_bad_indent.clas.abap