Disallow Configured Custom Regex Patterns
WarningAnti-Patterns & Bad Practices#EC NO_CUSTOM_PATTERNRemote Enabled
Overview
Disallow configured custom regex patterns.
ATC Finding Message:
Source code matches forbidden custom regex pattern
Rationale
Enterprise coding standards often require banning specific placeholder comments (such as TODO, FIXME, XXX), temporary variable patterns (such as TMP_* or DEBUG_*), sensitive keywords, or prohibited terminology. This check inspects all tokens against a configurable table of regular expressions, reporting any prohibited matches.
Non-Compliant
abap
" Flagged when 'TODO' is configured in PATTERNS
DATA lv_todo_item TYPE i.Compliant
abap
DATA lv_clean_item TYPE i.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 | Description & Guidance |
|---|---|---|---|
PATTERN | String | TODO|FIXME|XXX | Regular expression pattern to disallow (defaults to TODO|FIXME|XXX) |
Suppression
To suppress findings for this rule, append the pseudo-comment to the statement:
abap
" Standard pseudo-comment:
... "#EC NO_CUSTOM_PATTERN
" SAP CI_ prefix format:
... "#EC CI_NO_CUSTOM_PATTERNRelated Rules
- Avoid Using ABAP Keywords as Identifier Names —
#EC NO_KEYWORD_NAME - Avoid Hardcoding System & Tenant Environment Checks (sy-sysid, sy-mandt) —
#EC NO_HARDCODED_ENV - Avoid Dead Code with Constant Conditions —
#EC NO_DEAD_CODE
Technical Details
- Native ATC Class:
ZCL_SKYLINT_NO_CUSTOM_PATTERN - Implementation File: zcl_skylint_no_custom_pattern.clas.abap