refactor abap style and improve readability #602
Merged
oblomov-dev merged 80 commits intostandardfrom Apr 22, 2026
Merged
Conversation
Remove redundant CREATE PUBLIC (default behavior) and FINAL keywords from 205 class definitions per CLAUDE.md style guide. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Class names should always be written in lowercase in both DEFINITION and IMPLEMENTATION per CLAUDE.md style guide. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Align local helper method names with the framework's own lifecycle convention (view_display, popup_display, popover_display, popover_list_display) per CLAUDE.md app structure guide. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Strips trailing whitespace between the last token and the period on 373 ABAP statements across 121 files for consistent formatting. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Collapses 3+ consecutive blank lines to at most 1 inside class definitions and methods, and at most 2 between top-level blocks, per the CLAUDE.md blank-line rules. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
CLAUDE.md: "No blank line directly below a section keyword." Fixes 272 class definitions across the samples. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
CLAUDE.md: "No blank line above ENDCLASS." (class definition block). https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Classes must always declare PROTECTED SECTION and PRIVATE SECTION even if empty, in the correct order (PUBLIC, PROTECTED, PRIVATE). https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Methods and class blocks must be separated by exactly 2 blank lines per the CLAUDE.md formatting rules. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
CLAUDE.md: "Always add exactly 1 blank line at the very start of a method body" and "at the very end of a method body (before ENDMETHOD)". https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
CLAUDE.md: "Add one blank line above each section keyword — unless the preceding section is empty." https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
abapGit file format requires exactly one trailing newline. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
The chained-declaration colon syntax adds noise when only one item is declared. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Replace the CASE abap_true anti-pattern with the canonical ELSEIF chain on lifecycle checks, and align string literals with backticks. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
CLAUDE.md: "Use backticks for all string literals, not single quotes." Applies to common framework methods (client->_event, _event_client, check_on_event, message_box_display, message_toast_display, popup_display, popover_destroy, nav_app_leave). https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Covers WHEN event clauses and additional client-> method arguments (set_push_state, follow_up_action, popover_destroy, _bind*). Skips strings containing backticks to avoid breaking embedded template literals. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Covers common view parameters (text, title, type, icon, etc.) with safe replacement that skips lines already containing backticks to avoid breaking embedded literals. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Handles ->method( 'value' ) single-argument patterns common in content(), label(), button() and similar view builders. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Applies to any \"= 'value'\" pattern on lines without existing backticks, covering field initializers in VALUE #() constructors and named-parameter assignments beyond the previously handled list. Two currency tables (apps 060, 201) were kept on single quotes: abaplint's "statement too long" check flips when converted. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Handles chain continuations like )->label( 'x' and WHEN 'EVENT' patterns that the previous round skipped. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Covers CS/CP/CA/etc. string comparison operators and simple helper function arguments like get_txt( 'xxx' ). https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Matches the canonical class structure shown in the CLAUDE.md template. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Matches the canonical class structure in the CLAUDE.md template. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
CLAUDE.md: "No blank line between a TYPES definition and the DATA declaration that directly uses it." https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
CLAUDE.md: "Always add 1 blank line before ELSEIF and ELSE." https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
CLAUDE.md: "Prefer functional to procedural language constructs — use var = VALUE #( ). to reset a variable, never CLEAR var." Applied for variables whose names signal a table or structure type (t_, mt_, lt_, s_, ms_, ls_). https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Extends the previous CLEAR conversion to dereferenced table fields. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
CLAUDE.md: "Never use an init flag attribute. Always use client->check_on_init( ) instead." https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Replaces IF me->z2ui5_if_app~check_initialized = abap_false with IF client->check_on_init( ). per CLAUDE.md. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Two fixes bundled together: 1. Multi-line pipe-templates in apps 067 and 306 had apostrophes inside their JSON payload incorrectly converted to backticks by commit 2f53c9c. The character-level parser did not carry pipe- template state across line boundaries. Restored to apostrophes. 2. Additional z2ui5_/ui5_ helper renames to canonical names: ui5_callback -> on_navigation, ui5_view_main_display -> view_display, ui5_initialize/ui5_on_init/ui5_init -> on_init, ui5_handle_event -> on_event, ui5_display_popover -> popover_display, ui5_popup_input -> popup_display, z2ui5_set_search -> set_search, z2ui5_load_cc -> load_cc, z2ui5_view_* popup helpers -> view_display_*. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Leftovers after removing empty placeholder methods. CLAUDE.md: "Max 1 consecutive blank line inside the definition block." https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Simplifies the dispatcher when the pattern was:
IF client->check_on_init( ).
...
RETURN.
ENDIF.
other_method( ).
This is now:
IF client->check_on_init( ).
...
ELSE.
other_method( ).
ENDIF.
https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
->stringify( ) is the canonical way to obtain the XML string from a z2ui5_cl_xml_view, as shown in the CLAUDE.md template. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Last leftover ->get_root( )->xml_get( ) pattern in app 050. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Mirrors the rule applied to IF/ELSEIF: single-statement branches do not get a blank line between the condition and the statement. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Unifies with the canonical naming shown in the CLAUDE.md template and with client->view_display( ) (the framework call they all end with). Co-exists cleanly because the local and framework names live in different scopes. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Conventional c_ prefix signals a read-only constant; align the declaration keyword with the intent. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Place z2ui5_if_app on the same line as INTERFACES — consistent with the pattern in all other demo apps. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Deletes 113 commented-out lines of exploratory HTTP client code from the WHEN PDF branch. Clean code rule: commented-out code is dead weight; the version control system keeps history. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Clean code rule: commented-out code is dead weight; history is preserved in git. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Additional 3 blocks cleaned up. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
- CONSTANTS moved before DATA in app 085 (TYPES/CONSTANTS/DATA/METHODS order) - 20 previously-missing blank lines inserted above ELSE/ELSEIF https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
The TODO comments from ABAP cleaner flagged these as unused. Change from CATCH cx_root INTO DATA(root). to CATCH cx_root. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
- Remove ABAP cleaner TODO comments that were purely informational - Fix "Ouput" → "Output" typo in app 306 - Fix "inital" → "initial" typo in app 348 https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
CLAUDE.md: "This entire project is in English." Translated two German comments in apps 130 and 212 to English. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
App 202 used a manual av_init boolean; the framework already exposes this via client->check_on_init( ). Also drop the now-unused mv_check_init field in app 306. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
The ! prefix is only needed when the parameter name clashes with an ABAP keyword. For ordinary parameter names (!client, !count, !table, !i_column, etc.) it is just noise — removed 29 instances. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Aligns with the canonical view_display name used elsewhere; no naming conflicts since none of these files define both. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
Prefer one declaration per line rather than chained DATA:/METHODS:. Clean ABAP style; avoids the colon-continuation noise. Applied in apps 172, 189, 231 and the WebSocket sample s_05_ws. https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
CleanABAP prefers IS INITIAL over the symbolic = abap_false for abap_bool comparisons (applies to IF/AND/OR conditions). https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg
This reverts commit 5155114.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request applies comprehensive code formatting to ABAP class definitions across the codebase to enforce consistent style guidelines. The changes focus on standardizing class declaration syntax and removing unnecessary blank lines.
Key Changes
Class definition declarations: Consolidated multi-line class definition statements into single-line format
Interface declarations: Removed unnecessary blank lines between
PUBLIC SECTION.andINTERFACESstatements across all demo app classesType definitions: Standardized period placement at end of type definitions (e.g.,
END OF ty_s_tab.instead ofEND OF ty_s_tab .)Class implementation headers: Normalized class implementation declaration formatting (e.g.,
CLASS z2ui5_cl_demo_app_042 IMPLEMENTATION.instead ofCLASS Z2UI5_CL_DEMO_APP_042 IMPLEMENTATION.)Whitespace cleanup: Removed excessive blank lines in class sections while maintaining readability
Implementation Details
https://claude.ai/code/session_01Xmf5YThiDL34iixHkkXkyg