Re: Problems with checkstyle tests on Windows (Was [VOTE] Release Apache Maven Checkstyle Plugin version 3.1.0)

2019-07-18 Thread Eric Lilja
Ah, thanks Vladimir, that's even better. I was not 100% sure it would be
possible to retain complete control over resulting line endings for those
files, regardless of user git settings of stuff like autocrlf = true and
whatnot, but it seems there is, that's great news. Thanks!

- Eric L

On Thu, Jul 18, 2019 at 2:00 PM Vladimir Sitnikov <
sitnikov.vladi...@gmail.com> wrote:

> Eric>In that case, we should generate the test files (to
> Eric>avoid git interfering), one with linux-style EOLs and one with
> Eric>Windows-style EOLs and test with both.
>
> You'd better have those files under Git control, and you could just specify
> .gitattributes so the LF file is always LF, and CRLF file is always CRLF.
>
> That is way simpler than generation of the file(s), and it is way easier to
> understand by humans
>
> Vladimir
>


Re: Problems with checkstyle tests on Windows (Was [VOTE] Release Apache Maven Checkstyle Plugin version 3.1.0)

2019-07-18 Thread Vladimir Sitnikov
Eric>In that case, we should generate the test files (to
Eric>avoid git interfering), one with linux-style EOLs and one with
Eric>Windows-style EOLs and test with both.

You'd better have those files under Git control, and you could just specify
.gitattributes so the LF file is always LF, and CRLF file is always CRLF.

That is way simpler than generation of the file(s), and it is way easier to
understand by humans

Vladimir


Re: Problems with checkstyle tests on Windows (Was [VOTE] Release Apache Maven Checkstyle Plugin version 3.1.0)

2019-07-18 Thread Eric Lilja
Hi Enrico!

If I remember correctly, a number of weeks ago I tried using Checkstyle
8.21 with maven-checkstyle-plugin (I had simply cloned the
maven-checkstyle-plugin repository) and it did solve the problem with the
test case discussed in this thread. However, as I recall there was another,
unrelated, test that started failing with Checkstyle 8.21, which I did not
investigate. I haven't tried Checkstyle 8.22, which has been released since.

Additionally, we could be a bit more ambitious in the
file-should-end-with-newline-test, if we also want to verify it's indeed
platform-agnostic now. In that case, we should generate the test files (to
avoid git interfering), one with linux-style EOLs and one with
Windows-style EOLs and test with both.

I might give it a go to uplift Checkstyle to 8.22 and possibly expand the
test as outlined above if you think it sounds like a reasonable proposition

- Eric L

On Wed, Jul 17, 2019 at 1:32 PM Enrico Olivelli  wrote:

> Il mer 17 lug 2019, 13:28 Eric Lilja  ha scritto:
>
> > I believe, if we instead upgrade to Checkstyle 8.21 or later, we don't
> need
> > to do any of those alternative approaches.
> >
> > https://github.com/checkstyle/checkstyle/issues/4073
>
>
> Eric
> I think it is the best idea
> Do you have cycles to give it a try?
>
> Enrico
>
>
>
> >
> > - Eric L
> >
> >
> > On Wed, Jul 17, 2019 at 1:20 PM Vladimir Sitnikov <
> > sitnikov.vladi...@gmail.com> wrote:
> >
> > > Robert>A clone from Git succeeds, but the sources.zip fails.
> > > Robert>The files in the zip are generated on a unix system, so all EOLs
> > in
> > > text files are LF
> > > Robert>...
> > > Robert>The fix: add a setup.groovy to the IT and rewrite the java files
> > > with OS specific EOLs
> > >
> > > Alternative approaches:
> > > A) Provide both Linux (LF) and Windows (CRLF) source distributions
> (e.g.
> > > *.zip and *.tgz).
> > > B) Specify "lineSeparator" explicitly. Then you could have both CRLF
> and
> > LF
> > > files at the same time and verify if those work
> > > C) Generate file at the build stage. If you generate it into target/
> > > directory, then you could generate the file with appropriate for the
> > > platform enconding
> > > D) Ensure the file is always in LF or CRLF by adding a relevant
> > > .gitattributes entry
> > >
> > > Vladimir
> > >
> >
>