Formatting changes in Log4j

2023-04-18 Thread Piotr P. Karwasz
Hi all,

As discussed during Sunday's meeting, in the following weeks I would
like to perform these cleanup jobs on our repos:

1. On Friday evening: merge
https://github.com/apache/logging-parent/pull/10 and publish
`logging-parent`. This contains a basic Spotless configuration for
Java, XML, POM and YAML files. Summarizing:

* These files must use LF for the build to succeed. I will add to each
repo a `.gitattributes` file roughly equivalent to a
`core.autocrlf=input` setting.
* Trailing space will be removed,
* Files end with a new line,
* A header like in
https://www.apache.org/legal/src-headers.html#headers is used, but
rewrapped to limit the amount of changes necessary. The header is
indented using ' * ' for Java, '  ~ ' for XML and '# ' for YAML.

In Java files:

* indenting tabs will be replaced with 4 spaces,
* imports will be grouped into `java`, `javax`, `jakarta`, everything
else and sorted. On Eclipse I have a small problem with sorting:
Eclipse sorts using the English (or maybe local), Spotless uses
`String.compareTo`. I think it will not cause too many problems. I
don't know how it works on IDEA,

The main elements of POM files will be sorted, but no sorting inside
those elements (e.g. no sorting for dependencies).

2. When `logging-parent` is published PRs will be created in
`l-log4j2`, `l-l-transform` and `l-l-tools`. These will probably be
huge (50k lines), but hopefully verifiable with `git diff`,

3. I'll apply the 4 "Finalize" recipes from OpenRewrite:
https://docs.openrewrite.org/reference/recipes/java/cleanup.

4. Back to some useful work (releasing `l-l-transform` and checking
`main` for regressions).

If you have a strong feeling against these rules, please express them
in this thread. I mostly need them to avoid distractions when
comparing `2.x` with `main`.

Piotr


Re: Formatting changes in Log4j

2023-04-18 Thread Gary Gregory
" The header is
indented using ' * ' for Java, '  ~ ' for XML and '# ' for YAML."

Also # for property files.

Gary


On Tue, Apr 18, 2023, 17:29 Piotr P. Karwasz 
wrote:

> Hi all,
>
> As discussed during Sunday's meeting, in the following weeks I would
> like to perform these cleanup jobs on our repos:
>
> 1. On Friday evening: merge
> https://github.com/apache/logging-parent/pull/10 and publish
> `logging-parent`. This contains a basic Spotless configuration for
> Java, XML, POM and YAML files. Summarizing:
>
> * These files must use LF for the build to succeed. I will add to each
> repo a `.gitattributes` file roughly equivalent to a
> `core.autocrlf=input` setting.
> * Trailing space will be removed,
> * Files end with a new line,
> * A header like in
> https://www.apache.org/legal/src-headers.html#headers is used, but
> rewrapped to limit the amount of changes necessary. The header is
> indented using ' * ' for Java, '  ~ ' for XML and '# ' for YAML.
>
> In Java files:
>
> * indenting tabs will be replaced with 4 spaces,
> * imports will be grouped into `java`, `javax`, `jakarta`, everything
> else and sorted. On Eclipse I have a small problem with sorting:
> Eclipse sorts using the English (or maybe local), Spotless uses
> `String.compareTo`. I think it will not cause too many problems. I
> don't know how it works on IDEA,
>
> The main elements of POM files will be sorted, but no sorting inside
> those elements (e.g. no sorting for dependencies).
>
> 2. When `logging-parent` is published PRs will be created in
> `l-log4j2`, `l-l-transform` and `l-l-tools`. These will probably be
> huge (50k lines), but hopefully verifiable with `git diff`,
>
> 3. I'll apply the 4 "Finalize" recipes from OpenRewrite:
> https://docs.openrewrite.org/reference/recipes/java/cleanup.
>
> 4. Back to some useful work (releasing `l-l-transform` and checking
> `main` for regressions).
>
> If you have a strong feeling against these rules, please express them
> in this thread. I mostly need them to avoid distractions when
> comparing `2.x` with `main`.
>
> Piotr
>


Re: Formatting changes in Log4j

2023-04-18 Thread Piotr P. Karwasz
Hi Gary,

On Wed, 19 Apr 2023 at 00:02, Gary Gregory  wrote:
>
> " The header is
> indented using ' * ' for Java, '  ~ ' for XML and '# ' for YAML."
>
> Also # for property files.

Right, I didn't include properties files in the original config, but I
corrected the PR.

Piotr