Home
Lines should not end with trailing whitespaces
Description
The Pl/SQL code rule "Lines should not end with trailing whitespaces" states that each line of code should not contain any unnecessary whitespace characters at the end. This helps to ensure that the code is properly formatted and easier to read. Additionally, it can help to prevent errors from occurring due to unexpected whitespace characters.
Key Benefits
- Easier to read: No need to search for trailing whitespaces, making it easier to read code.
- Reduce errors: Trailing whitespaces can cause errors in code, so removing them can reduce the risk of errors.
- Better collaboration: Removing trailing whitespaces makes it easier for multiple people to work on the same codebase without introducing unnecessary changes.
Non-compliant Code Example
SELECT
/*
Customer table is for holding customer data such as Name, Address, etc.
Also it contains some crucial information like Credit limit, amount spent etc.
*/
NAME,
ADDRESS,
CREDIT_LIMIT
FROM
CUSTOMERS
Where ADDRESS like '%BUNGALOWS% --Non compliant code (Lines ending with trailing whitespace)
';
Compliant Code Example
SELECT
/*
Customer table is for holding customer data such as Name, Address, etc.
Also it contains some crucial information like Credit limit, amount spent etc.
*/
NAME,
ADDRESS,
CREDIT_LIMIT
FROM
CUSTOMERS
Where ADDRESS like '%BUNGALOWS%'; --Compliant code (Lines ending without trailing whitespace)