Re: Spotless is annoying

2023-09-04 Thread Gary Gregory
Or git does it on check out and I need to re-checkout the whole thing.

Gaty

On Mon, Sep 4, 2023, 1:18 AM Ralph Goers  wrote:

> I suspect the problem here is the settings being used in Gary’s IDE. I
> know IntelliJ has a similar feature to convert line endings to what is
> appropriate for the environment.
>
> Ralph
>
> > On Sep 1, 2023, at 8:21 AM, Piotr P. Karwasz 
> wrote:
> >
> > Hi Gary,
> >
> > On Fri, 1 Sept 2023 at 14:19, Gary D. Gregory 
> wrote:
> >>
> >> How is this possible now that we use spotless in 2.x:
> >
> > It's a CRLF vs LF problem. About 6 months ago[1] I added a
> > `.gitattributes` file[2] that forces line endings as LF also on
> > Windows. This should solve two problems:
> > * approach the goal of reproducibility on **any** OS with an OpenJDK
> > compiler; some Maven plugins may still use system-dependent line
> > endings, but most of the files should be Ok,
> > * allow Spotless to work without Git (line endings are configured as
> > UNIX instead of the default "ask Git").
> >
> > Git should take care of line endings after the file "is touched by
> > Git" (whatever that means). Usually a:
> >
> > git add --renormalize *
> >
> > helps. Another possibility is that Eclipse reconverts the line endings
> to CRLF.
> >
> > Piotr
> >
> > [1] https://lists.apache.org/thread/bvt8s71gf2k2g5lhy5sbf20xtcpvvbbo
> > [2] https://github.com/apache/logging-log4j2/blob/2.x/.gitattributes
>
>


Re: Spotless is annoying

2023-09-03 Thread Ralph Goers
I suspect the problem here is the settings being used in Gary’s IDE. I know 
IntelliJ has a similar feature to convert line endings to what is appropriate 
for the environment.

Ralph

> On Sep 1, 2023, at 8:21 AM, Piotr P. Karwasz  wrote:
> 
> Hi Gary,
> 
> On Fri, 1 Sept 2023 at 14:19, Gary D. Gregory  wrote:
>> 
>> How is this possible now that we use spotless in 2.x:
> 
> It's a CRLF vs LF problem. About 6 months ago[1] I added a
> `.gitattributes` file[2] that forces line endings as LF also on
> Windows. This should solve two problems:
> * approach the goal of reproducibility on **any** OS with an OpenJDK
> compiler; some Maven plugins may still use system-dependent line
> endings, but most of the files should be Ok,
> * allow Spotless to work without Git (line endings are configured as
> UNIX instead of the default "ask Git").
> 
> Git should take care of line endings after the file "is touched by
> Git" (whatever that means). Usually a:
> 
> git add --renormalize *
> 
> helps. Another possibility is that Eclipse reconverts the line endings to 
> CRLF.
> 
> Piotr
> 
> [1] https://lists.apache.org/thread/bvt8s71gf2k2g5lhy5sbf20xtcpvvbbo
> [2] https://github.com/apache/logging-log4j2/blob/2.x/.gitattributes



Re: Spotless is annoying

2023-09-01 Thread Gary Gregory
That did not help but this sure does: -Dspotless.check.skip=true

Gary

On Fri, Sep 1, 2023 at 1:29 PM Gary Gregory  wrote:

> Ah! Excellent news, I'll give it a go.
>
> Gary
>
> On Fri, Sep 1, 2023, 11:21 AM Piotr P. Karwasz 
> wrote:
>
>> Hi Gary,
>>
>> On Fri, 1 Sept 2023 at 14:19, Gary D. Gregory 
>> wrote:
>> >
>> > How is this possible now that we use spotless in 2.x:
>>
>> It's a CRLF vs LF problem. About 6 months ago[1] I added a
>> `.gitattributes` file[2] that forces line endings as LF also on
>> Windows. This should solve two problems:
>>  * approach the goal of reproducibility on **any** OS with an OpenJDK
>> compiler; some Maven plugins may still use system-dependent line
>> endings, but most of the files should be Ok,
>>  * allow Spotless to work without Git (line endings are configured as
>> UNIX instead of the default "ask Git").
>>
>> Git should take care of line endings after the file "is touched by
>> Git" (whatever that means). Usually a:
>>
>> git add --renormalize *
>>
>> helps. Another possibility is that Eclipse reconverts the line endings to
>> CRLF.
>>
>> Piotr
>>
>> [1] https://lists.apache.org/thread/bvt8s71gf2k2g5lhy5sbf20xtcpvvbbo
>> [2] https://github.com/apache/logging-log4j2/blob/2.x/.gitattributes
>>
>


Re: Spotless is annoying

2023-09-01 Thread Gary Gregory
Ah! Excellent news, I'll give it a go.

Gary

On Fri, Sep 1, 2023, 11:21 AM Piotr P. Karwasz 
wrote:

> Hi Gary,
>
> On Fri, 1 Sept 2023 at 14:19, Gary D. Gregory  wrote:
> >
> > How is this possible now that we use spotless in 2.x:
>
> It's a CRLF vs LF problem. About 6 months ago[1] I added a
> `.gitattributes` file[2] that forces line endings as LF also on
> Windows. This should solve two problems:
>  * approach the goal of reproducibility on **any** OS with an OpenJDK
> compiler; some Maven plugins may still use system-dependent line
> endings, but most of the files should be Ok,
>  * allow Spotless to work without Git (line endings are configured as
> UNIX instead of the default "ask Git").
>
> Git should take care of line endings after the file "is touched by
> Git" (whatever that means). Usually a:
>
> git add --renormalize *
>
> helps. Another possibility is that Eclipse reconverts the line endings to
> CRLF.
>
> Piotr
>
> [1] https://lists.apache.org/thread/bvt8s71gf2k2g5lhy5sbf20xtcpvvbbo
> [2] https://github.com/apache/logging-log4j2/blob/2.x/.gitattributes
>


Re: Spotless is annoying

2023-09-01 Thread Piotr P. Karwasz
Hi Gary,

On Fri, 1 Sept 2023 at 14:19, Gary D. Gregory  wrote:
>
> How is this possible now that we use spotless in 2.x:

It's a CRLF vs LF problem. About 6 months ago[1] I added a
`.gitattributes` file[2] that forces line endings as LF also on
Windows. This should solve two problems:
 * approach the goal of reproducibility on **any** OS with an OpenJDK
compiler; some Maven plugins may still use system-dependent line
endings, but most of the files should be Ok,
 * allow Spotless to work without Git (line endings are configured as
UNIX instead of the default "ask Git").

Git should take care of line endings after the file "is touched by
Git" (whatever that means). Usually a:

git add --renormalize *

helps. Another possibility is that Eclipse reconverts the line endings to CRLF.

Piotr

[1] https://lists.apache.org/thread/bvt8s71gf2k2g5lhy5sbf20xtcpvvbbo
[2] https://github.com/apache/logging-log4j2/blob/2.x/.gitattributes


Spotless is annoying

2023-09-01 Thread Gary D. Gregory
How is this possible now that we use spotless in 2.x:

mvn clean install -pl log4j-api,log4j-core -DskipTests

[INFO] 
[INFO] Reactor Summary for Apache Log4j API 2.20.1-SNAPSHOT:
[INFO]
[INFO] Apache Log4j API ... FAILURE [ 22.303 s]
[INFO] Apache Log4j Core .. SKIPPED
[INFO] 
[INFO] BUILD FAILURE
[INFO] 
[INFO] Total time:  25.370 s
[INFO] Finished at: 2023-09-01T08:10:43-04:00
[INFO] 
[ERROR] Failed to execute goal 
com.diffplug.spotless:spotless-maven-plugin:2.30.0:check (default-spotless) on 
project log4j-api: The following files had format violations:
[ERROR] src\main\java\org\apache\logging\log4j\internal\package-info.java
[ERROR] @@ -1,20 +1,20 @@
[ERROR] -/*\r\n
[ERROR] - * Licensed to the Apache Software Foundation (ASF) under one 
or more\r\n
[ERROR] - * contributor license agreements. See the NOTICE file 
distributed with\r\n
[ERROR] - * this work for additional information regarding copyright 
ownership.\r\n
[ERROR] - * The ASF licenses this file to You under the Apache license, 
Version 2.0\r\n
[ERROR] - * (the "License"); you may not use this file except in 
compliance with\r\n
[ERROR] - * the License. You may obtain a copy of the License at\r\n
[ERROR] - *\r\n
[ERROR] - *  http://www.apache.org/licenses/LICENSE-2.0\r\n
[ERROR] - *\r\n
[ERROR] - * Unless required by applicable law or agreed to in writing, 
software\r\n
[ERROR] - * distributed under the License is distributed on an "AS IS" 
BASIS,\r\n
[ERROR] - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 
express or implied.\r\n
[ERROR] - * See the license for the specific language governing 
permissions and\r\n
[ERROR] - * limitations under the license.\r\n
[ERROR] - */\r\n
[ERROR] -/**\r\n
[ERROR] - * This package should be considered private.\r\n
[ERROR] - */\r\n
[ERROR] -package org.apache.logging.log4j.internal;\r\n
[ERROR] +/*\n
[ERROR] + * Licensed to the Apache Software Foundation (ASF) under one 
or more\n
[ERROR] + * contributor license agreements. See the NOTICE file 
distributed with\n
[ERROR] + * this work for additional information regarding copyright 
ownership.\n
[ERROR] + * The ASF licenses this file to You under the Apache license, 
Version 2.0\n
[ERROR] + * (the "License"); you may not use this file except in 
compliance with\n
[ERROR] + * the License. You may obtain a copy of the License at\n
[ERROR] + *\n
[ERROR] + *  http://www.apache.org/licenses/LICENSE-2.0\n
[ERROR] + *\n
[ERROR] + * Unless required by applicable law or agreed to in writing, 
software\n
[ERROR] + * distributed under the License is distributed on an "AS IS" 
BASIS,\n
[ERROR] + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 
express or implied.\n
[ERROR] + * See the license for the specific language governing 
permissions and\n
[ERROR] + * limitations under the license.\n
[ERROR] + */\n
[ERROR] +/**\n
[ERROR] + * This package should be considered private.\n
[ERROR] + */\n
[ERROR] +package org.apache.logging.log4j.internal;\n
[ERROR] src\main\java\org\apache\logging\log4j\message\package-info.java
[ERROR] @@ -1,21 +1,21 @@
[ERROR] -/*\r\n
[ERROR] - * Licensed to the Apache Software Foundation (ASF) under one 
or more\r\n
[ERROR] - * contributor license agreements. See the NOTICE file 
distributed with\r\n
[ERROR] - * this work for additional information regarding copyright 
ownership.\r\n
[ERROR] - * The ASF licenses this file to You under the Apache license, 
Version 2.0\r\n
[ERROR] - * (the "License"); you may not use this file except in 
compliance with\r\n
[ERROR] ... (36 more lines that didn't fit)
[ERROR] Violations also present in:
[ERROR] src\main\java\org\apache\logging\log4j\package-info.java
[ERROR] src\main\java\org\apache\logging\log4j\simple\package-info.java
[ERROR] src\main\java\org\apache\logging\log4j\spi\package-info.java
[ERROR] src\main\java\org\apache\logging\log4j\status\package-info.java
[ERROR] src\main\java\org\apache\logging\log4j\util\package-info.java
[ERROR] Run 'mvn spotless:apply' to fix these violations.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and