Skip to content

Commit

Permalink
version 1.18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgrassau committed Jul 8, 2024
1 parent 9dd4219 commit bdbc18f
Show file tree
Hide file tree
Showing 22 changed files with 155 additions and 44 deletions.
2 changes: 1 addition & 1 deletion com.sap.adt.abapcleaner.app/abapcleaner.product
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>

<product name="ABAP cleaner" uid="com.sap.adt.abapcleaner.app" application="com.sap.adt.abapcleaner.standalone.app" version="1.17.2.qualifier" type="features" includeLaunchers="true" autoIncludeRequirements="true">
<product name="ABAP cleaner" uid="com.sap.adt.abapcleaner.app" application="com.sap.adt.abapcleaner.standalone.app" version="1.18.0" type="features" includeLaunchers="true" autoIncludeRequirements="true">

<configIni use="default">
</configIni>
Expand Down
4 changes: 2 additions & 2 deletions com.sap.adt.abapcleaner.app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
<modelVersion>4.0.0</modelVersion>
<groupId>com.sap.adt.abapcleaner</groupId>
<artifactId>com.sap.adt.abapcleaner.app</artifactId>
<version>1.17.2-SNAPSHOT</version>
<version>1.18.0</version>
<name>com.sap.adt.abapcleaner.app</name>
<packaging>eclipse-repository</packaging>

<parent>
<artifactId>parent</artifactId>
<groupId>com.sap.adt.abapcleaner</groupId>
<version>1.17.2-SNAPSHOT</version>
<version>1.18.0</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion com.sap.adt.abapcleaner.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="com.sap.adt.abapcleaner.feature"
label="ABAP cleaner"
version="1.17.2.qualifier">
version="1.18.0">

<description>
ABAP cleaner plug-in for ABAP Development Tools
Expand Down
4 changes: 2 additions & 2 deletions com.sap.adt.abapcleaner.feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
<modelVersion>4.0.0</modelVersion>
<artifactId>com.sap.adt.abapcleaner.feature</artifactId>
<groupId>com.sap.adt.abapcleaner</groupId>
<version>1.17.2-SNAPSHOT</version>
<version>1.18.0</version>
<name>com.sap.adt.abapcleaner.feature</name>
<packaging>eclipse-feature</packaging>

<parent>
<artifactId>parent</artifactId>
<groupId>com.sap.adt.abapcleaner</groupId>
<version>1.17.2-SNAPSHOT</version>
<version>1.18.0</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion com.sap.adt.abapcleaner.gui/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: com.sap.adt.abapcleaner.gui;singleton:=true
Bundle-Version: 1.17.2.qualifier
Bundle-Version: 1.18.0
Bundle-Vendor: %Provider-Name
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-17
Expand Down
4 changes: 2 additions & 2 deletions com.sap.adt.abapcleaner.gui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
<modelVersion>4.0.0</modelVersion>
<groupId>com.sap.adt.abapcleaner</groupId>
<artifactId>com.sap.adt.abapcleaner.gui</artifactId>
<version>1.17.2-SNAPSHOT</version>
<version>1.18.0</version>
<name>com.sap.adt.abapcleaner.gui</name>
<packaging>eclipse-plugin</packaging>

<parent>
<artifactId>parent</artifactId>
<groupId>com.sap.adt.abapcleaner</groupId>
<version>1.17.2-SNAPSHOT</version>
<version>1.18.0</version>
<relativePath>../</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2419,7 +2419,8 @@ private void createReleaseNoteDocumentation() {
"for opening the issues behind these improvements!", "for all your ideas!", "for inspiring these improvements!",
"for opening the issues that led to these improvements!" };
final String SEP = System.lineSeparator();
final int HASH_LENGTH = 7;
final int HASH_LENGTH_MIN = 7;
final int HASH_LENGTH_MAX = 12;

String text = SystemClipboard.getText();
if (StringUtil.isNullOrEmpty(text)) {
Expand All @@ -2437,8 +2438,8 @@ private void createReleaseNoteDocumentation() {

// remove hash
int spacePos = line.indexOf(' ');
if (spacePos == HASH_LENGTH && StringUtil.consistsOf(line.substring(0, HASH_LENGTH), "0123456789abcdef")) {
line = line.substring(HASH_LENGTH + 1).trim();
if (spacePos >= HASH_LENGTH_MIN && spacePos <= HASH_LENGTH_MAX && StringUtil.consistsOf(line.substring(0, spacePos), "0123456789abcdef")) {
line = line.substring(spacePos + 1).trim();
}

// remove initial parenthesis like (HEAD -> v#.#.#), (upstream/main), (tag: v#.#.#)
Expand Down
4 changes: 2 additions & 2 deletions com.sap.adt.abapcleaner.updatesite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<artifactId>com.sap.adt.abapcleaner.updatesite</artifactId>
<version>1.17.2-SNAPSHOT</version>
<version>1.18.0</version>
<name>ABAP Cleaner for ABAP Development Tools (ADT)</name>
<packaging>eclipse-repository</packaging>

<parent>
<artifactId>parent</artifactId>
<groupId>com.sap.adt.abapcleaner</groupId>
<version>1.17.2-SNAPSHOT</version>
<version>1.18.0</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion com.sap.adt.abapcleaner/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: com.sap.adt.abapcleaner;singleton:=true
Bundle-Version: 1.17.2.qualifier
Bundle-Version: 1.18.0
Bundle-Vendor: %Provider-Name
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-17
Expand Down
4 changes: 2 additions & 2 deletions com.sap.adt.abapcleaner/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
<modelVersion>4.0.0</modelVersion>
<groupId>com.sap.adt.abapcleaner</groupId>
<artifactId>com.sap.adt.abapcleaner</artifactId>
<version>1.17.2-SNAPSHOT</version>
<version>1.18.0</version>
<name>com.sap.adt.abapcleaner</name>
<packaging>eclipse-plugin</packaging>

<parent>
<artifactId>parent</artifactId>
<groupId>com.sap.adt.abapcleaner</groupId>
<version>1.17.2-SNAPSHOT</version>
<version>1.18.0</version>
<relativePath>../</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,25 @@ public static String getVersion() {

public static Release[] getReleases() {
return new Release[] {
Release.create("1.17.0", 2024, 6, 24),
Release.create("1.16.0", 2024, 4, 12),
Release.create("1.15.0", 2024, 3, 25),
Release.create("1.14.0", 2024, 3, 11),
Release.create("1.13.0", 2024, 1, 5),
Release.create("1.18.0", 2024, 7, 8),
Release.create("1.17.0", 2024, 6, 24),
Release.create("1.16.0", 2024, 4, 12),
Release.create("1.15.0", 2024, 3, 25),
Release.create("1.14.0", 2024, 3, 11),
Release.create("1.13.0", 2024, 1, 5),
Release.create("1.12.0", 2023, 11, 27),
Release.create("1.11.0", 2023, 11, 6),
Release.create("1.10.0", 2023, 11, 1),
Release.create("1.9.0", 2023, 10, 30),
Release.create("1.8.0", 2023, 10, 23),
Release.create("1.7.0", 2023, 10, 10),
Release.create("1.6.0", 2023, 10, 2),
Release.create("1.5.0", 2023, 7, 5),
Release.create("1.4.0", 2023, 6, 12),
Release.create("1.3.0", 2023, 6, 6),
Release.create("1.2.0", 2023, 5, 22),
Release.create("1.1.0", 2023, 5, 7),
Release.create("1.0.0", 2023, 4, 21)
Release.create("1.11.0", 2023, 11, 6),
Release.create("1.10.0", 2023, 11, 1),
Release.create("1.9.0", 2023, 10, 30),
Release.create("1.8.0", 2023, 10, 23),
Release.create("1.7.0", 2023, 10, 10),
Release.create("1.6.0", 2023, 10, 2),
Release.create("1.5.0", 2023, 7, 5),
Release.create("1.4.0", 2023, 6, 12),
Release.create("1.3.0", 2023, 6, 6),
Release.create("1.2.0", 2023, 5, 22),
Release.create("1.1.0", 2023, 5, 7),
Release.create("1.0.0", 2023, 4, 21)
};
}

Expand Down
19 changes: 19 additions & 0 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@ as well as bugfixes of reported issues, i.e. anything that enhances or changes t
For a complete list of changes (including documentation, tests, refactoring etc.), please refer to
the list of [commits](../../../commits/main).

## 2024-07-08 (version 1.18.0)

Great **thanks** to [**vonglan**](https://github.com/vonglan), [**Ennowulff**](https://github.com/Ennowulff),
[**JoachimEck**](https://github.com/JoachimEck), [**apanys**](https://github.com/apanys), [**MichiFr**](https://github.com/MichiFr),
[**cawoodmonads**](https://github.com/cawoodmonads), [**ConjuringCoffee**](https://github.com/ConjuringCoffee) and
[**openPhiL**](https://github.com/openPhiL) for inspiring these improvements and fixes!

* Added menu "View / **Use ADT-Style Colors**" to select between ADT-style and classic **color profile** for diff view ([#282](../../../issues/282))
* Added labels "**Before cleanup**" and "**After cleanup**" to diff view ([#249](../../../issues/249))
* Enhanced rule '**Align parameters and components**' for **group key** in LOOP AT ... GROUP BY ([#330](../../../issues/330))
* Enhanced rule '**Use string templates to assemble text**' with option for **lines without operands** ([#323](../../../issues/323))
* Enhanced '**Use assert class instead of ASSERT**' with **explanation** in examples ([#314](../../../issues/314))
* Fixed rule '**Replace TRANSLATE with string functions**' for unknown, potentially **structured types** ([#318](../../../issues/318))
* Fixed rule '**Align declarations**' for comment line and **line-start comma** ([#335](../../../issues/335))
* Fixed rule '**Delete unused variables**' for obsolete **REPLACE ... INTO** ([#331](../../../issues/331))
* Fixed rule '**Align SELECT ... FROM ... JOIN**' for **ON ... JOIN** ([#332](../../../issues/332))
* Updated **ABAP grammar file**
* Updated **known CamelCase names** for CDS views and fields

## 2024-06-24 (version 1.17.1)

**Thanks a lot**, [**agoeb**](https://github.com/agoeb) and [**matthewdjb**](https://github.com/matthewdjb) for the bug reports behind these improvements!
Expand Down
2 changes: 1 addition & 1 deletion docs/rules.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Available Cleanup Rules

ABAP cleaner offers 75 cleanup rules with a total of 298 configuration options:
ABAP cleaner offers 75 cleanup rules with a total of 301 configuration options:

## Empty Lines

Expand Down
20 changes: 19 additions & 1 deletion docs/rules/AlignParametersRule.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,20 @@ This rule is part of the **essential** profile, as it is explicitly demanded by
( item_key = '20220040000101' event_date = '20220401' total_qty = '30' qty_unit = 'DAY' amount = '1500.00' currency = 'EUR' )
( item_key = '20220050000101' event_date = '20220501' total_qty = '30' qty_unit = 'DAY' amount = '2000.00' currency = 'EUR' ) ).
READ TABLE lt_any_table_name ASSIGNING <ls_table_row>
READ TABLE lt_any_table_name ASSIGNING <ls_table_row>
WITH KEY field1 = ls_any_structure-field1
fld2 = ls_any_structure-fld2
long_field_name3 = ls_any_structure-long_field_name_3.
result = VALUE #( BASE result ( id = 1 name = 'abc' ) ).
LOOP AT lt_table ASSIGNING <fs>
GROUP BY ( key1 = <fs>-any_component key2 = get_value( <fs>-other_component )
indx = GROUP INDEX count = GROUP SIZE )
ASSIGNING FIELD-SYMBOL(<group>).
cl_demo_output=>write( |{ <group>-indx } { <group>-key1 } { <group>-key2 } { <group>-count }| ).
ENDLOOP.
ENDMETHOD.
```

Expand Down Expand Up @@ -147,6 +155,16 @@ Resulting code:
result = VALUE #( BASE result
( id = 1 name = 'abc' ) ).
LOOP AT lt_table ASSIGNING <fs>
GROUP BY ( key1 = <fs>-any_component
key2 = get_value( <fs>-other_component )
indx = GROUP INDEX
count = GROUP SIZE )
ASSIGNING FIELD-SYMBOL(<group>).
cl_demo_output=>write( |{ <group>-indx } { <group>-key1 } { <group>-key2 } { <group>-count }| ).
ENDLOOP.
ENDMETHOD.
```

Expand Down
30 changes: 30 additions & 0 deletions docs/rules/AssertClassRule.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,21 @@ Note that the class name must be adjusted to the respective application \(CX\_..
CLASS cl_product_code IMPLEMENTATION.
METHOD use_assert_class.
" Explanation: Using ASSERT in product code is discouraged, because it immediately dumps, even when the code
" is called from a test. You can therefore only test the 'happy' cases. This is unsatisfactory, because for
" code to be clean and testable, you should be able to safeguard that assertions work correctly in unhappy cases.
" The solution is to not use ASSERT in product code, but to rather call a 'productive' assert class cx_XYZ_assert,
" which has methods just like CL_ABAP_UNIT_ASSERT to check your expectations, but is specific to your solution XYZ.
" With that, even the 'unhappy' cases can be tested, because your tests can catch cx_XYZ_assert exceptions and
" ensure they are raised when they should.
" Once you have created such a class (short example see below), this cleanup rule helps to automatically convert
" existing ASSERT statements into static cx_XYZ_assert=>...( ) calls. Since the exact desired behavior of the
" cx_XYZ_assert class may depend on your solution, the class name is not fixed, but can be configured above.
" To exclude accidental use of this rule, this cleanup rule is intentionally deactivated at first, and the
" class cx_assert does not exist, but must first be adjusted to your own implementation.
ASSERT lo_instance IS BOUND.
ASSERT is_any_structure-component IS NOT BOUND.
Expand Down Expand Up @@ -106,6 +121,21 @@ Resulting code:
CLASS cl_product_code IMPLEMENTATION.
METHOD use_assert_class.
" Explanation: Using ASSERT in product code is discouraged, because it immediately dumps, even when the code
" is called from a test. You can therefore only test the 'happy' cases. This is unsatisfactory, because for
" code to be clean and testable, you should be able to safeguard that assertions work correctly in unhappy cases.
" The solution is to not use ASSERT in product code, but to rather call a 'productive' assert class cx_XYZ_assert,
" which has methods just like CL_ABAP_UNIT_ASSERT to check your expectations, but is specific to your solution XYZ.
" With that, even the 'unhappy' cases can be tested, because your tests can catch cx_XYZ_assert exceptions and
" ensure they are raised when they should.
" Once you have created such a class (short example see below), this cleanup rule helps to automatically convert
" existing ASSERT statements into static cx_XYZ_assert=>...( ) calls. Since the exact desired behavior of the
" cx_XYZ_assert class may depend on your solution, the class name is not fixed, but can be configured above.
" To exclude accidental use of this rule, this cleanup rule is intentionally deactivated at first, and the
" class cx_assert does not exist, but must first be adjusted to your own implementation.
cx_assert=>assert_bound( lo_instance ).
cx_assert=>assert_not_bound( is_any_structure-component ).
Expand Down
9 changes: 8 additions & 1 deletion docs/rules/SpaceBeforePeriodRule.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This rule is part of the **essential** profile, as it is explicitly demanded by

* \[X\] Remove space before period
* \[X\] Remove space before chain commas
* \[X\] Move comma or period across comment lines
* \[X\] Execute on CLASS ... DEFINITION sections, too

## Examples
Expand All @@ -39,6 +40,9 @@ CLASS any_class IMPLEMENTATION.
ev_any_value ,
ev_other_value " comment
, ev_third_value
* comment line
" another comment line
, ev_fourth_value
.
TRY .
Expand Down Expand Up @@ -73,7 +77,10 @@ CLASS any_class IMPLEMENTATION.
CLEAR:
ev_any_value,
ev_other_value, " comment
ev_third_value.
ev_third_value,
* comment line
" another comment line
ev_fourth_value.
TRY.
any_operation( ).
Expand Down
11 changes: 10 additions & 1 deletion docs/rules/StringTemplateRule.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ This rule is part of the **essential** profile, as it is explicitly demanded by
## Options

* Embed operands with |\{ ... \}|: \[if result is shorter or equal\]
* \[X\] Always convert text literals in concatenations
* \[X\] Convert text literals in concatenations regardless of result length
* \[ \] Only convert text literals if line contains operands to embed
* \[X\] Ignore multi-line operands at line start or end
* \[X\] Keep string templates with control characters \\t \\n \\r separate

Expand Down Expand Up @@ -57,6 +58,10 @@ This rule is part of the **essential** profile, as it is explicitly demanded by
" escape chars are changed accordingly:
lv_escape1 = 'To ''be''' && ` or ``not`` to be`.
lv_escape2 = 'String templates must escape |' && ` as well as { and }.`.
" you may want to use string templates only on lines that contain operands to embed:
rv_example = `3 + 5 = ` && `8` && `. `
&& `a + b = ` && c && `.`.
ENDMETHOD.
```

Expand Down Expand Up @@ -98,6 +103,10 @@ Resulting code:
" escape chars are changed accordingly:
lv_escape1 = |To 'be' or `not` to be|.
lv_escape2 = |String templates must escape \| as well as \{ and \}.|.
" you may want to use string templates only on lines that contain operands to embed:
rv_example = |3 + 5 = 8. |
&& |a + b = { c }.|.
ENDMETHOD.
```

Expand Down
Loading

0 comments on commit bdbc18f

Please sign in to comment.