2013/4/25 Davide D'Alto <davide(a)hibernate.org>
Thanks Gunnar,
in the .gitattributes file we define the rule that says that all the new
lines must be converted to "lf" when pushing on the repository.
When someone clone the repository all the files seems to have "lf" has new
line character.
Interesting, according to
https://help.github.com/articles/dealing-with-line-endings, the "text"
option you use in .gittattributes should use native endings during
checkout: "When committed [files] are stored with LF, on checkout they are
converted to the OS's native line endings.
So either Git or CheckStyle seem not working as described in their
documentation.
Anyways, the reg exp approach seems to work, so I don't want to bother you
:)
The error happens because checkstyle uses the system newline character when
executing the rule, so in WIndows will check using "crlf"
and with a Mac
will use "cr" (according to the documentation:
http://checkstyle.sourceforge.net/config_misc.html).
Since we can only set the property in the rule to one of this value I
don't feel very confident about what can happen if you create a new file or
edit the file using different tools or system.
I'm not 100% sure that the regex won't have some false positive but it
seems more portable.
On Thu, Apr 25, 2013 at 2:11 PM, Gunnar Morling <gunnar(a)hibernate.org>wrote:
> Davide,
>
> It works on my Mac, too.
>
> I'm wondering though why the original NewlineAtEndOfFile rule didn't work
> on all systems. There is a property "lineSeparator" which defaults to
> "system" as per the docs, which I had understood to do the right thing on
> all platforms. Have you tried setting it to "system" explicitly?
>
> But OTOH the regexp approach has the nice effect that it rejects multiple
> new lines which the original rule doesn't.
>
> --Gunnar
>
>
>
> 2013/4/25 Davide D'Alto <davide(a)hibernate.org>
>
>> Thanks you Gunnar,
>>
>> Davide
>>
>>
>> On Thu, Apr 25, 2013 at 12:07 PM, Gunnar Morling <gunnar(a)hibernate.org
>> >wrote:
>>
>> >
>> > Am 25.04.2013 12:34 schrieb "Davide D'Alto"
<davide(a)hibernate.org>:
>> >
>> > >
>> > > Thanks Guillaume,
>> > > are you going to test it on Windows isn't?
>> > >
>> > > We still need a volunteer with a Mac.
>> >
>> > I can do that.
>> >
>> > --Gunnar
>> >
>> > >
>> > >
>> > > On Thu, Apr 25, 2013 at 11:10 AM, Guillaume SCHEIBEL <
>> > > guillaume.scheibel(a)gmail.com> wrote:
>> > >
>> > > > hello,
>> > > >
>> > > > I'm checking and keep you up to date.
>> > > >
>> > > > Guillaume
>> > > >
>> > > >
>> > > > 2013/4/25 Davide D'Alto <davide(a)hibernate.org>
>> > > >
>> > > >> Hi,
>> > > >> we have a problem with one of the rules in checkstyle:
>> > NewLineAtEndOfFile
>> > > >>
>> > > >> It seems that this rule in Windows is using the wrong
character to
>> > check
>> > > >> if
>> > > >> there is a new line at the end of a file.
>> > > >>
>> > > >> To solve this issue I've tried to remove the rule and use
a
>> regular
>> > > >> expression instead.
>> > > >> The problem is that I don't have Windows or a Mac to test
it.
>> > > >>
>> > > >> Is there anyone that could check the pull request on WIndows
>> and/or
>> > Mac?
>> > > >>
>> > > >> The link to the pull request is
>> > > >>
https://github.com/hibernate/hibernate-ogm/pull/183
>> > > >>
>> > > >> Thanks,
>> > > >> Davide
>> > > >> _______________________________________________
>> > > >> hibernate-dev mailing list
>> > > >> hibernate-dev(a)lists.jboss.org
>> > > >>
https://lists.jboss.org/mailman/listinfo/hibernate-dev
>> > > >>
>> > > >
>> > > >
>> > > _______________________________________________
>> > > hibernate-dev mailing list
>> > > hibernate-dev(a)lists.jboss.org
>> > >
https://lists.jboss.org/mailman/listinfo/hibernate-dev
>> >
>> >
>> _______________________________________________
>> hibernate-dev mailing list
>> hibernate-dev(a)lists.jboss.org
>>
https://lists.jboss.org/mailman/listinfo/hibernate-dev
>>
>
>