abaplint rules documentation

abaplint can be configured by placing a abaplint.json file in the root of the git repository. If no configuration file is found, the default configuration will be used, which contains have all rules enabled.

Get default configuration by running abaplint -d > abaplint.json

abaplint-clean-code contains rule documentation as well as abaplint.json definitions which attempt to align abaplint with the official Clean ABAP styleguide.


7bit_ascii - Check for 7bit ascii
Only allow characters from the 7bit ASCII set.

abapdoc - Check abapdoc
Various checks regarding abapdoc. Base rule checks for existence of abapdoc for public class methods and all interface methods.

allowed_object_naming - Allowed object naming
Enforces basic name length and namespace restrictions

allowed_object_types - Check allowed object types
Restricts the set of allowed object types.

ambiguous_statement - Check for ambigious statements
Checks for ambiguity between deleting or modifying from internal and database table Add "TABLE" keyword or "@" for escaping SQL variables

avoid_use - Avoid use of certain statements
Detects usage of certain statements.

begin_end_names - Check BEGIN END names
Check BEGIN OF and END OF names match

chain_mainly_declarations - Chain mainly declarations
Chain mainly declarations

check_abstract - Check abstract methods and classes
Checks abstract methods and classes: - class defined as abstract and final, - non-abstract class contains abstract methods

check_comments - Check Comments
Various checks for comment usage.

check_ddic - Check DDIC
Checks the types of DDIC objects can be resolved, the namespace of the development/errors can be configured in "errorNamespace"

check_include - Check INCLUDEs
Checks INCLUDE statements

check_no_handler_pragma - Check if NO_HANDLER can be removed
Checks NO_HANDLER pragmas that can be removed

check_syntax - Check syntax experimental
Enables syntax check and variable resolution

check_text_elements - Check text elements
Check text elements exists or matches code

check_transformation_exists - Check transformation exists
Checks that used XSLT transformations exist.

class_attribute_names - Class attributes naming
Allows you to enforce a pattern, such as a prefix, for class variable names.

cloud_types - Check cloud types
Checks that the package does not contain any object types unsupported in cloud ABAP.

colon_missing_space - Colon missing space
Checks for missing spaces after colons in chained statements.

commented_code - Find commented code
Detects usage of commented out code.

constructor_visibility_public - Check constructor visibility is public
Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.

contains_tab - Code contains tab
Checks for usage of tabs (enable to enforce spaces)

definitions_top - Place definitions in top of routine
Checks that definitions are placed at the beginning of methods.

description_empty - Description in class must exist
Ensures descriptions in class metadata exist.

double_space - Double space quick fix
Checks that only a single space follows certain common statements.

empty_line_in_statement - Find empty lines in statements
Checks that statements do not contain empty lines.

empty_statement - Remove emty statement quick fix
Checks for empty statements (an empty statement is a single dot)

empty_structure - Find empty blocks
Checks that the code does not contain empty blocks.

exit_or_check - Find EXIT or CHECK outside loops
Detects usages of EXIT or CHECK statements outside of loops. Use RETURN to leave procesing blocks instead.

exporting - EXPORTING can be omitted quick fix
Detects EXPORTING statements which can be omitted.

forbidden_identifier - Forbidden Identifier
Forbid use of specified identifiers, list of regex. Used in the transpiler to find javascript keywords in ABAP identifiers, https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44

forbidden_void_type - Forbidden Void Type
Forbid use of specified void types. Inspiration: BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70, DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD

form_no_dash - No dashes in FORM names
Checks for a Dash in form names

form_tables_obsolete - TABLES parameters are obsolete
Checks for TABLES parameters in forms.

fully_type_constants - Fully type constants
Checks constants for full typing - no implicit typing allowed.

functional_writing - Use functional writing
Detects usage of call method when functional style calls can be used.

global_class - Global class checks
Checks related to global classes. * global classes must be in own files * file names must match class name * global classes must be global definitions

identical_form_names - Identical FORM names
Detects identically named FORMs

if_in_if - IF in IF
Detects nested ifs which can be refactored to a single condition using AND.

implement_methods - Implement methods
Chekcs for abstract methods which need implementing.

in_statement_indentation - In-statement indentation
Checks alignment within block statement declarations which span multiple lines, such as multiple conditions in IF statements. Example: IF 1 = 1 AND 2 = 2.

indentation - Indentation
Checks indentation

inline_data_old_versions - Inline data, old versions
Checks for inline data declarations in older releases. Only active for versions less than v740sp02

keep_single_parameter_on_one_line - Keep single parameters on one line
Keep single parameter calls on one line

keyword_case - Keyword case
Checks that keywords have the same case. Non-keywords must be lower case.

line_length - Line length
Detects lines exceeding the provided maximum length.

line_only_punc - Line containing only punctuation
Detects lines containing only punctuation.

local_class_naming - Local class naming conventions
Allows you to enforce a pattern, such as a prefix, for local class names.

local_testclass_location - Local testclass location
Checks that local test classes are placed in the test include.

local_variable_names - Local variable naming conventions
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.

main_file_contents - Main file contents
Checks related to report declarations.

max_one_statement - Max one statement per line quick fix
Checks that each line contains only a single statement.

message_exists - Check MESSAGE exists
In message statements, check that the message class + id exist

method_length - Method Length
Checks relating to method length.

method_parameter_names - Method parameter naming conventions
Allows you to enforce a pattern, such as a prefix, for method parameter names

mix_returning - Mix of returning and exporting
Checks that methods don't have a mixture of returning and exporting/changing parameters

msag_consistency - MSAG consistency check
Checks the validity of messages in message classes

nesting - Check nesting depth
Checks for methods exceeding a maximum nesting depth

newline_between_methods - New line between methods
Checks for newlines between method implementations.

no_public_attributes - No public attributes
Checks that classes and interfaces don't contain any public attributes. Exceptions are excluded from this rule.

object_naming - Object naming conventions
Allows you to enforce a pattern, such as a prefix, for object names

obsolete_statement - Obsolete statements
Checks for usages of certain obsolete statements

parser_error - Parser error
Checks for syntax unrecognized by abaplint

prefer_returning_to_exporting - Prefer RETURNING to EXPORTING
Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.

preferred_compare_operator - Preferred compare operator
Configure undesired operator variants

prefix_is_current_class - Prefix is current class
Reports errors if the current class or interface references itself with "current_class=>"

release_idoc - Release iDoc
Checks idoc types and segments are set to status released

remove_descriptions - Remove descriptions
Ensures you have no descriptions in metadata of methods, parameters, etc. For class descriptions, see rule description_empty.

rfc_error_handling - RFC error handling
Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls

selection_screen_naming - Selection screen naming conventions
Allows you to enforce a pattern, such as a prefix, for selection-screen variable names.

sequential_blank - Sequential blank lines
Checks that code does not contain more than the configured number of blank lines in a row.

short_case - Short CASE
Checks for CASE statements which have fewer than the specified number of branches

sicf_consistency - SICF consistency
Checks the validity of ICF services

space_before_colon - Space before colon
Checks that there are no spaces in front of colons in chained statements.

space_before_dot - Space before dot
Checks for extra spaces before dots at the ends of statements

sql_escape_host_variables - Escape SQL host variables
Escape SQL host variables, from 740sp05

start_at_tab - Start at tab
Checks that statements start at tabstops.

superclass_final - Super class final
Checks that classes which are inherited from are not declared as FINAL.

tabl_enhancement_category - TABL enhancement category must be set
Checks that tables do not have the enhancement category 'not classified'

try_without_catch - TRY without CATCH
Checks for TRY blocks without a CATCH and CLEANUP block

type_begin_single_include - TYPE BEGIN contains single field
Finds TYPE BEGIN with just one INCLUDE TYPE

type_form_parameters - Type FORM parameters
Checks for untyped FORM parameters

types_naming - TYPES naming conventions
Allows you to enforce a pattern for TYPES definitions

unknown_types - Unknown types experimental
Enables check for unknown data types, respects errorNamespace

unreachable_code - Unreachable code
Checks for unreachable code.

unused_variables - Unused variables experimental
Checks for unused variables

use_new - Use NEW
Checks for deprecated CREATE OBJECT statements.

when_others_last - WHEN OTHERS last
Checks that WHEN OTHERS is placed the last within a CASE statement.

whitespace_end - Whitespace at end of line
Checks for redundant whitespace at the end of each line.

xml_consistency - XML consistency
Checks the consistency of main XML files, eg. naming