GitHub line ending woes

670 views
Skip to first unread message

tony...@att.net

unread,
Feb 6, 2021, 1:09:53 PM2/6/21
to OpenPnP
Does anyone know definitively how to configure git so that the repository's line endings don't get changed inadvertently?  If so, can you update the Wiki to include that in the Developers section?

I think the repository is supposed to use Unix (LF) line endings but I see many files in the repository with Windows (CRLF) line endings (the attached file lists all the files in the Test branch of the repository with CRLF line endings).  Note that you can't look at your local repository to see this because git automatically converts the line endings when it copies files between remote and local repositories.  To generate this listing, I downloaded a zip of the Test branch, unzipped it into a temporary folder, and then used the file command.

I know I'm partially to blame for some of the files with CRLF line endings because when I made some of my early PRs, I didn't even know there were git settings to control such things.  I currently have these two settings which I think are pertinent and correct but I'm not sure if they are the necessary and sufficient set: 

core.autocrlf=true
merge.renormalize=true

Thanks,
Tony
FilesWithBadLineEndings.txt

John Plocher

unread,
Feb 6, 2021, 1:15:14 PM2/6/21
to ope...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com.

Jason von Nieda

unread,
Feb 6, 2021, 1:22:39 PM2/6/21
to ope...@googlegroups.com
Git does not by default change line endings, unless you have added configuration for that. Except now that I say that I have a very vague recollection that maybe some Windows Git packages default to auto.

In any case, my recommendation is to not have Git modify line endings and to instead ensure that you are using UNIX line endings in your editor. Most editors will maintain whatever appears to be evident in the file.

If we want to fix this issue and have a good starting point I can fix all the line endings (and probably tabs to spaces) and commit it all as one big commit. That will make it easy to ensure we all have a good reference to start with.

Jason


--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com.
--
Sent from my BeOS enabled toaster

Clemens Koller

unread,
Feb 6, 2021, 2:05:22 PM2/6/21
to ope...@googlegroups.com
Hi, Jason!

I recommend to go with core.autocrlf to false or to input in this case and work with .gitattributes.

If you translate your line endings and commit them as one big commit, you will usually loose git blame functionality.
So, I recommend to change the line endings only when you need to / touch files anyway.

Alternatively, you could merge all open branches / features, clean up bugs, and finally clean up crlfs and then do a major release and ask all devs to rebase their work at least beyond this major release. It should also be unlikely that you need to revert older commits.

Just my five cents.

Clemens
> To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com <mailto:openpnp+u...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> Sent from my BeOS enabled toaster
>
> --
> You received this message because you are subscribed to the Google Groups "OpenPnP" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com <mailto:openpnp+u...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.

tony...@att.net

unread,
Feb 6, 2021, 5:42:27 PM2/6/21
to OpenPnP
The problem with fixing line endings only when you need to touch the file is that reviewing the real change (the reason you touched the file) is difficult because diff shows all lines of the file have been changed.

Tony

tony...@att.net

unread,
Feb 8, 2021, 4:24:16 PM2/8/21
to OpenPnP
I'm a git noob but since nobody else seems to be working on it, I took a stab at setting up a .gitattributes file (see attachment).
.gitattributes

Jason von Nieda

unread,
Feb 8, 2021, 5:26:05 PM2/8/21
to ope...@googlegroups.com
Hi Tony,

I'll reiterate that I don't think we should have Git convert any line endings. There's no reason to have source control modify files that the user doesn't explicitly modify IMHO.

So, it seems to me if we're going to add a .gitattributes, it should just contain:
* -text

I think this would tell Git that no files should have any conversions performed, and it should override the core.autocrlf setting if people have it set. If people submit PRs with incorrect line endings, we can simply ask them to fix their environment or convert the line endings on the incorrect files.

Jason


To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/10c0f3f6-7fb7-4eb0-86dd-6e6dd0b7efb9n%40googlegroups.com.

tony...@att.net

unread,
Feb 8, 2021, 6:25:13 PM2/8/21
to OpenPnP
I'm fine with that.  Who's making the change?  Who's fixing the files that already have the wrong line endings?

Tony

Niclas Hedhman

unread,
Feb 9, 2021, 3:39:21 AM2/9/21
to ope...@googlegroups.com

Can you give an example of a file that has "wrong line endings"?

Modern editors are pretty good at handling line endings, varying from "not changing unless line modified" to "use same as rest of file" to "fix to".

Related to this is "Tabs", which in the OpenPNP codebase is "mixed" (IMHO, worst of both worlds) and annoys me to no end. My editor reports 1801 Tabs in src/main, and should IMVHO also be corrected (seems that "space" is the expectation).


Cheers
Niclas

Clemens Koller

unread,
Feb 9, 2021, 4:26:04 AM2/9/21
to ope...@googlegroups.com
Good point, Niclas.

Are there any developers using editors/IDEs which cannot deal with "wrong line endings" or are even introducing them?

Sometimes, some generated code or intermediate files will have to be in CRLFs or will only be re-generated as such.
I just remember Intel (former Altera) Designer stuff, i.e. and maybe still Atmel Solution Files .sln.
Sometimes you want to have generated these files as-is in the repo because not all devs are able to regenerate them (i.e. no license for a tool).

If there are no special cases which need special treatment (which would go into .gitattributes), maybe it's sufficient to have a core.autocrlf=false or input in the local repo (no --global).

Further reading:
https://docs.github.com/en/github/using-git/configuring-git-to-handle-line-endings

Regards,

Clemens

On 09/02/2021 09.39, Niclas Hedhman wrote:
>
> Can you give an example of a file that has "wrong line endings"?
>
> Modern editors are pretty good at handling line endings, varying from "not changing unless line modified" to "use same as rest of file" to "fix to".
>
> Related to this is "Tabs", which in the OpenPNP codebase is "mixed" (IMHO, worst of both worlds) and annoys me to no end. My editor reports 1801 Tabs in src/main, and should IMVHO also be corrected (seems that "space" is the expectation).
>
>
> Cheers
> Niclas
>
> > To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com> <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com?utm_medium=email&utm_source=footer>>.
> >
> > --
> > Sent from my BeOS enabled toaster
> >
> > --
> > You received this message because you are subscribed to the Google Groups "OpenPnP" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com <mailto:openpnp+u...@googlegroups.com>.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com> <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com?utm_medium=email&utm_source=footer>>.
>
> --
> You received this message because you are subscribed to the Google Groups "OpenPnP" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/10c0f3f6-7fb7-4eb0-86dd-6e6dd0b7efb9n%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/10c0f3f6-7fb7-4eb0-86dd-6e6dd0b7efb9n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google Groups "OpenPnP" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com <mailto:openpnp+u...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/1ee86163-7e64-4451-82f8-e182a4d1e938n%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/1ee86163-7e64-4451-82f8-e182a4d1e938n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google Groups "OpenPnP" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com <mailto:openpnp+u...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CADmm%2BKeuRw8s35Etnh-cYZvkeatdGPDMSU1Wngft6Q_tH67HNQ%40mail.gmail.com <https://groups.google.com/d/msgid/openpnp/CADmm%2BKeuRw8s35Etnh-cYZvkeatdGPDMSU1Wngft6Q_tH67HNQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.

tony...@att.net

unread,
Feb 9, 2021, 10:00:08 AM2/9/21
to OpenPnP
> Can you give an example of a file that has "wrong line endings"?
The file I attached at the start of this thread contained a list.  I can't say that they are all wrong but the vast majority on the list are.

Tony 

Jason von Nieda

unread,
Feb 9, 2021, 10:09:28 AM2/9/21
to ope...@googlegroups.com
Hi Tony (and Mark),

Once Mark is ready to merge test we can do this. While it's possible to do it beforehand, it will complicate things. So, once Mark merges test, I'll merge other PRs that are outstanding, or fix them in place, and then convert the entire repo to LF and convert tabs to spaces.

Thanks,
Jason


tony...@att.net

unread,
Feb 9, 2021, 10:16:32 AM2/9/21
to OpenPnP
Jason,

That sounds good to me.  I assume you will also be adding a .gitattributes file and updating the Wiki to let developers know how to setup things on their end (make sure that they setup their editors to use LF versus CRLF).

Thanks,
Tony

ma...@makr.zone

unread,
Feb 9, 2021, 11:02:54 AM2/9/21
to ope...@googlegroups.com

Jason,

I'm no expert in these matters but I think the mentioned  .gitattributes will not enforce encoding they will simply suppress any conversion. So if a user editor or tool does mess up line-endings, it won't correct them and also won't warn us.

Maybe there are other ways to enforce line-endings on checkin, but all advice I found on Stackoverflow etc. points to enabling the CRLF->LF conversion on input. You can still tell it to leave LF->LF untouched on output so Windows users can still (and should still) try to work with LF files, but with a safety net.  ;-)

https://stackoverflow.com/a/42135910/13250135

Note, that some bugs in git have been fixed and I suspect the CRLF line that came from me might be due to a git version older than the mentioned 2.10 installed on my old Windows PC back then.

https://github.com/git/git/blob/master/Documentation/RelNotes/2.10.0.txt#L248

Tony, what version of git have you installed?

_Mark

Jason von Nieda

unread,
Feb 9, 2021, 11:23:28 AM2/9/21
to ope...@googlegroups.com
Hi Mark,

On Tue, Feb 9, 2021 at 10:02 AM ma...@makr.zone <ma...@makr.zone> wrote:

Jason,

I'm no expert in these matters but I think the mentioned  .gitattributes will not enforce encoding they will simply suppress any conversion. So if a user editor or tool does mess up line-endings, it won't correct them and also won't warn us.


Yea, that's what I am going for. I don't think source control should modify files. We can catch problems during PRs. If someone submits a PR full of CRLFs it's a simple matter for them to run dos2unix on their files and recommit, and hopefully do better next time. I think we can keep this simple for now.

Jason



tony...@att.net

unread,
Feb 9, 2021, 12:27:27 PM2/9/21
to OpenPnP
> Tony, what version of git have you installed?  
git version 2.21.0.windows.1

I also use the free version of SmartGit as a graphical interface.  I suppose that could be introducing some problems but I don't explicitly know of any CRLFs that I have introduced since I set  core.autocrlf=true.  Unfortunately, I don't know exactly when I made that change (due to a mistake that prevented my git configuration files from being backed-up) so I don't know for sure.

Aren't there files that should have CRLF endings - like Windows .bat files?  Maybe modern Windows can handle LF line endings too?

Jason,
How do you ensure new files don't get introduced with CRLFs?  Looking at them on the GitHub web doesn't provide any indication of what line endings are used.  Are you going to have an automated way of checking files?

Tony

Niclas Hedhman

unread,
Feb 9, 2021, 12:57:34 PM2/9/21
to ope...@googlegroups.com
On Tue, Feb 9, 2021 at 6:27 PM tony...@att.net <tony...@att.net> wrote:
How do you ensure new files don't get introduced with CRLFs?  Looking at them on the GitHub web doesn't provide any indication of what line endings are used.  Are you going to have an automated way of checking files?

A decent editor will be able to tell you...or at least be configured to tell you. Personally, I use IntelliJ IDEA and can simply do "Find in Path" (Ctrl-Shift-F) and do a regexp search with "\r\n", OR set UI to show all whitespace, which will render whitespace with a weak gray color, for permanent feedback.

You can also do "grep" to find these.

Niclas

tony...@att.net

unread,
Feb 9, 2021, 1:17:33 PM2/9/21
to OpenPnP
Niclas,

I know of lots or ways to check the line endings if you transfer the files from GitHub to a local repository.

Tony

Jason von Nieda

unread,
Feb 9, 2021, 1:21:30 PM2/9/21
to ope...@googlegroups.com
On Tue, Feb 9, 2021 at 11:27 AM tony...@att.net <tony...@att.net> wrote:
> Tony, what version of git have you installed?  
git version 2.21.0.windows.1

I also use the free version of SmartGit as a graphical interface.  I suppose that could be introducing some problems but I don't explicitly know of any CRLFs that I have introduced since I set  core.autocrlf=true.  Unfortunately, I don't know exactly when I made that change (due to a mistake that prevented my git configuration files from being backed-up) so I don't know for sure.

Aren't there files that should have CRLF endings - like Windows .bat files?  Maybe modern Windows can handle LF line endings too?

That would be the only one I can think of, and we've got only one of them, and it hasn't been changed in 10 years. I'm not going to sweat it. I think LF will actually work fine, as well.


Jason,
How do you ensure new files don't get introduced with CRLFs?  Looking at them on the GitHub web doesn't provide any indication of what line endings are used.  Are you going to have an automated way of checking files?

I'm pretty sure that the reason this comes up is that when a PR is submitted we see a bunch of lines that look changed, but have not been, because the line endings have been changed. So I think we can catch it there. If it continues to be an issue I can add a rule to the CheckStyle plugin, which is run with the Maven tests, to ensure no CR in Java files.

Jason

tony...@att.net

unread,
Feb 9, 2021, 1:25:24 PM2/9/21
to OpenPnP
> I'm pretty sure that the reason this comes up is that when a PR is submitted we see a bunch of lines that look changed, but have not been, because the line endings have been changed. So I think we can catch it there. 

That's only true for existing files, I'm specifically talking about new files. 

Tony

Jason von Nieda

unread,
Feb 9, 2021, 1:31:02 PM2/9/21
to ope...@googlegroups.com
On Tue, Feb 9, 2021 at 12:25 PM tony...@att.net <tony...@att.net> wrote:
> I'm pretty sure that the reason this comes up is that when a PR is submitted we see a bunch of lines that look changed, but have not been, because the line endings have been changed. So I think we can catch it there. 

That's only true for existing files, I'm specifically talking about new files. 

Ah yea, fair point. I'll add the rule to CheckStyle. This will cause `mvn test` to fail if there are CRLF and this will be visible on the PR and on local tests.

Jason



Tony
On Tuesday, February 9, 2021 at 12:21:30 PM UTC-6 Jason von Nieda wrote:
On Tue, Feb 9, 2021 at 11:27 AM tony...@att.net <tony...@att.net> wrote:
> Tony, what version of git have you installed?  
git version 2.21.0.windows.1

I also use the free version of SmartGit as a graphical interface.  I suppose that could be introducing some problems but I don't explicitly know of any CRLFs that I have introduced since I set  core.autocrlf=true.  Unfortunately, I don't know exactly when I made that change (due to a mistake that prevented my git configuration files from being backed-up) so I don't know for sure.

Aren't there files that should have CRLF endings - like Windows .bat files?  Maybe modern Windows can handle LF line endings too?

That would be the only one I can think of, and we've got only one of them, and it hasn't been changed in 10 years. I'm not going to sweat it. I think LF will actually work fine, as well.


Jason,
How do you ensure new files don't get introduced with CRLFs?  Looking at them on the GitHub web doesn't provide any indication of what line endings are used.  Are you going to have an automated way of checking files?

I'm pretty sure that the reason this comes up is that when a PR is submitted we see a bunch of lines that look changed, but have not been, because the line endings have been changed. So I think we can catch it there. If it continues to be an issue I can add a rule to the CheckStyle plugin, which is run with the Maven tests, to ensure no CR in Java files.

Jason

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.

Clemens Koller

unread,
Feb 9, 2021, 2:17:21 PM2/9/21
to ope...@googlegroups.com
There is already lot's of functionality in git.

Git can tell or abort if line-ending conversion (if i.e. enabled on checkout) might be dangerous in some cases.

See core.safecrlf in https://git-scm.com/docs/git-config

And it might be a good idea to add a git hook using your favorite tool to check your codebase before on pre/post-commit or checkout.

Clemens

On 09/02/2021 19.30, Jason von Nieda wrote:
>
> On Tue, Feb 9, 2021 at 12:25 PM tony...@att.net <mailto:tony...@att.net> <tony...@att.net <mailto:tony...@att.net>> wrote:
>
> > I'm pretty sure that the reason this comes up is that when a PR is submitted we see a bunch of lines that look changed, but have not been, because the line endings have been changed. So I think we can catch it there. 
>
> That's only true for /existing /files, I'm specifically talking about /new /files. 
>
>
> Ah yea, fair point. I'll add the rule to CheckStyle. This will cause `mvn test` to fail if there are CRLF and this will be visible on the PR and on local tests.
>
> Jason
>
>
>
> Tony
> On Tuesday, February 9, 2021 at 12:21:30 PM UTC-6 Jason von Nieda wrote:
>
> On Tue, Feb 9, 2021 at 11:27 AM tony...@att.net <tony...@att.net> wrote:
>
> > Tony, what version of git have you installed?  
> git version 2.21.0.windows.1
>
> I also use the free version of SmartGit as a graphical interface.  I suppose that could be introducing some problems but I don't explicitly know of any CRLFs that I have introduced since I set  core.autocrlf=true.  Unfortunately, I don't know exactly when I made that change (due to a mistake that prevented my git configuration files from being backed-up) so I don't know for sure.
>
> Aren't there files that /should/ have CRLF endings - like Windows .bat files?  Maybe modern Windows can handle LF line endings too?
>
>
> That would be the only one I can think of, and we've got only one of them, and it hasn't been changed in 10 years. I'm not going to sweat it. I think LF will actually work fine, as well.
>
>
> Jason,
> How do you ensure new files don't get introduced with CRLFs?  Looking at them on the GitHub web doesn't provide any indication of what line endings are used.  Are you going to have an automated way of checking files?
>
>
> I'm pretty sure that the reason this comes up is that when a PR is submitted we see a bunch of lines that look changed, but have not been, because the line endings have been changed. So I think we can catch it there. If it continues to be an issue I can add a rule to the CheckStyle plugin, which is run with the Maven tests, to ensure no CR in Java files.
>
> Jason
>
> --
> You received this message because you are subscribed to the Google Groups "OpenPnP" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com <mailto:openpnp+u...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/920817a8-eac1-46d1-bb7f-bdd7c0311c20n%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/920817a8-eac1-46d1-bb7f-bdd7c0311c20n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google Groups "OpenPnP" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com <mailto:openpnp+u...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CA%2BQw0jyrJw7WFnj7MpgiwvHNwL6YxiYZxNAuB%3D%2BUL3y_YoNAjQ%40mail.gmail.com <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jyrJw7WFnj7MpgiwvHNwL6YxiYZxNAuB%3D%2BUL3y_YoNAjQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.

ma...@makr.zone

unread,
Feb 9, 2021, 2:46:56 PM2/9/21
to ope...@googlegroups.com

> I'll add the rule to CheckStyle. This will cause `mvn test` to fail if there are CRLF

Perfect!

Clemens Koller

unread,
Feb 9, 2021, 3:10:22 PM2/9/21
to ope...@googlegroups.com
Hi, Tony and Jason!

Tony, I quickly checked your list of files:
*.java, *.py, *.xml files can be converted CRLF->LF and should be IMO fine.

Then, there are four remaining files, which might need special attention.

* samples\Demo Board\SeeedStudio_2layer_DRU_no_angle_20140221.dru; UTF-8 Unicode text, with very long lines, with CRLF line terminators
* samples\Demo Board\Seeed_Gerber_Generater_2-layer.cam; UTF-8 Unicode English text, with very long lines, with CRLF line terminators

I cannot say anything about the files for/from Seeed:

* src\main\resources\org\openpnp\translations_fr.properties; ISO-8859 English text, with CRLF line terminators
The french translations may be converted from ISO-8859 to UTF-8

* src\main\resources\org\openpnp\translations_ru.properties; ASCII text, with very long lines, with CRLF line terminators
The escaped Java cyrillic translations were committed by Jason. Maybe you want to translate that also over to UTF-8 by unescaping these.
I've attached the current version from HEAD unescaped and tested it quickly.

On java-11-openjdk the UTF-8 encoded translation_ru.properties seem to work - Screenshot attached.

I am just not sure if java-7-openjdk can deal with it.

Regards,

Clemens

On 09/02/2021 16.00, tony...@att.net wrote:
>> Can you give an example of a file that has "wrong line endings"?
> The file I attached at the start of this thread contained a list.  I can't say that they are all wrong but the vast majority on the list are.
>
> Tony 
>
> On Tuesday, February 9, 2021 at 3:26:04 AM UTC-6 Clemens Koller wrote:
>
> Good point, Niclas.
>
> Are there any developers using editors/IDEs which cannot deal with "wrong line endings" or are even introducing them?
>
> Sometimes, some generated code or intermediate files will have to be in CRLFs or will only be re-generated as such.
> I just remember Intel (former Altera) Designer stuff, i.e. and maybe still Atmel Solution Files .sln.
> Sometimes you want to have generated these files as-is in the repo because not all devs are able to regenerate them (i.e. no license for a tool).
>
> If there are no special cases which need special treatment (which would go into .gitattributes), maybe it's sufficient to have a core.autocrlf=false or input in the local repo (no --global).
>
> Further reading:
> https://docs.github.com/en/github/using-git/configuring-git-to-handle-line-endings <https://docs.github.com/en/github/using-git/configuring-git-to-handle-line-endings>
> > > To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com> <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com>> <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com?utm_medium=email&utm_source=footer> <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com?utm_medium=email&utm_source=footer>>>.
> > >
> > > --
> > > Sent from my BeOS enabled toaster
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups "OpenPnP" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com <mailto:openpnp+u...@googlegroups.com>.
> > > To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com> <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com>> <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com?utm_medium=email&utm_source=footer> <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com?utm_medium=email&utm_source=footer>>>.
> >
> > --
> > You received this message because you are subscribed to the Google Groups "OpenPnP" group.
> >
> > To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/10c0f3f6-7fb7-4eb0-86dd-6e6dd0b7efb9n%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/10c0f3f6-7fb7-4eb0-86dd-6e6dd0b7efb9n%40googlegroups.com> <https://groups.google.com/d/msgid/openpnp/10c0f3f6-7fb7-4eb0-86dd-6e6dd0b7efb9n%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/openpnp/10c0f3f6-7fb7-4eb0-86dd-6e6dd0b7efb9n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
> >
> > --
> > You received this message because you are subscribed to the Google Groups "OpenPnP" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com <mailto:openpnp+u...@googlegroups.com>.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/1ee86163-7e64-4451-82f8-e182a4d1e938n%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/1ee86163-7e64-4451-82f8-e182a4d1e938n%40googlegroups.com> <https://groups.google.com/d/msgid/openpnp/1ee86163-7e64-4451-82f8-e182a4d1e938n%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/openpnp/1ee86163-7e64-4451-82f8-e182a4d1e938n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
> >
> > --
> > You received this message because you are subscribed to the Google Groups "OpenPnP" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com <mailto:openpnp+u...@googlegroups.com>.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CADmm%2BKeuRw8s35Etnh-cYZvkeatdGPDMSU1Wngft6Q_tH67HNQ%40mail.gmail.com <https://groups.google.com/d/msgid/openpnp/CADmm%2BKeuRw8s35Etnh-cYZvkeatdGPDMSU1Wngft6Q_tH67HNQ%40mail.gmail.com> <https://groups.google.com/d/msgid/openpnp/CADmm%2BKeuRw8s35Etnh-cYZvkeatdGPDMSU1Wngft6Q_tH67HNQ%40mail.gmail.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/openpnp/CADmm%2BKeuRw8s35Etnh-cYZvkeatdGPDMSU1Wngft6Q_tH67HNQ%40mail.gmail.com?utm_medium=email&utm_source=footer>>.
>
> --
> You received this message because you are subscribed to the Google Groups "OpenPnP" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com <mailto:openpnp+u...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/dc859c08-b011-4090-9697-af426ed5889an%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/dc859c08-b011-4090-9697-af426ed5889an%40googlegroups.com?utm_medium=email&utm_source=footer>.
translations_ru.properties
20210209_OpenPnP2_translation_ru_in_utf-8.png

Jason von Nieda

unread,
Feb 9, 2021, 3:14:32 PM2/9/21
to ope...@googlegroups.com
The escaped translations are created by the tool recommended in https://github.com/openpnp/openpnp/blob/develop/TRANSLATIONS.md. Since this tool is handy for editing the files, and it prefers to escape rather than using UTF-8, we just go with it. The translation files are not required to be human readable since the tool is used to manage them.

It would certainly be nice if the files were UTF-8, so if someone wants to fork and modify the tool so it supports it properly, that would be awesome :)

Jason


Clemens Koller

unread,
Feb 9, 2021, 4:14:01 PM2/9/21
to ope...@googlegroups.com
Hi Jason!

On 09/02/2021 21.14, Jason von Nieda wrote:
> The escaped translations are created by the tool recommended in https://github.com/openpnp/openpnp/blob/develop/TRANSLATIONS.md <https://github.com/openpnp/openpnp/blob/develop/TRANSLATIONS.md>.
> Since this tool is handy for editing the files, and it prefers to escape rather than using UTF-8, we just go with it. The translation files are not required to be human readable since the tool is used to manage them.

Hmmm... i18n-editor doesn't compile here.

But when I quickly stare at some code in Resources.java, it seems to load and write some kind of "UTF-8" files as well:

UTF8_ENCODING = Charset.forName("UTF-8");
...
Files.write(resource.getPath(), Lists.newArrayList(content), UTF8_ENCODING);

Or maybe a System.setProperty("file.encoding","UTF-8"); is missing?
Well... Java noob.

Clemens

On 09/02/2021 21.14, Jason von Nieda wrote:
> The escaped translations are created by the tool recommended in https://github.com/openpnp/openpnp/blob/develop/TRANSLATIONS.md <https://github.com/openpnp/openpnp/blob/develop/TRANSLATIONS.md>. Since this tool is handy for editing the files, and it prefers to escape rather than using UTF-8, we just go with it. The translation files are not required to be human readable since the tool is used to manage them.
>
> It would certainly be nice if the files were UTF-8, so if someone wants to fork and modify the tool so it supports it properly, that would be awesome :)
>
> Jason
>
>
> On Tue, Feb 9, 2021 at 2:10 PM Clemens Koller <cleme...@gmx.net <mailto:cleme...@gmx.net>> wrote:
>
> Hi, Tony and Jason!
>
> Tony, I quickly checked your list of files:
> *.java, *.py, *.xml files can be converted CRLF->LF and should be IMO fine.
>
> Then, there are four remaining files, which might need special attention.
>
> * samples\Demo Board\SeeedStudio_2layer_DRU_no_angle_20140221.dru; UTF-8 Unicode text, with very long lines, with CRLF line terminators
> * samples\Demo Board\Seeed_Gerber_Generater_2-layer.cam; UTF-8 Unicode English text, with very long lines, with CRLF line terminators
>
> I cannot say anything about the files for/from Seeed:
>
> * src\main\resources\org\openpnp\translations_fr.properties; ISO-8859 English text, with CRLF line terminators
> The french translations may be converted from ISO-8859 to UTF-8
>
> * src\main\resources\org\openpnp\translations_ru.properties; ASCII text, with very long lines, with CRLF line terminators
> The escaped Java cyrillic translations were committed by Jason. Maybe you want to translate that also over to UTF-8 by unescaping these.
> I've attached the current version from HEAD unescaped and tested it quickly.
>
> On java-11-openjdk the UTF-8 encoded translation_ru.properties seem to work - Screenshot attached.
>
> I am just not sure if java-7-openjdk can deal with it.
>
> Regards,
>
> Clemens
>
> On 09/02/2021 16.00, tony...@att.net <mailto:tony...@att.net> wrote:
> >> Can you give an example of a file that has "wrong line endings"?
> > The file I attached at the start of this thread contained a list.  I can't say that they are all wrong but the vast majority on the list are.
> >
> > Tony 
> >
> > On Tuesday, February 9, 2021 at 3:26:04 AM UTC-6 Clemens Koller wrote:
> >
> >     Good point, Niclas.
> >
> >     Are there any developers using editors/IDEs which cannot deal with "wrong line endings" or are even introducing them?
> >
> >     Sometimes, some generated code or intermediate files will have to be in CRLFs or will only be re-generated as such.
> >     I just remember Intel (former Altera) Designer stuff, i.e. and maybe still Atmel Solution Files .sln.
> >     Sometimes you want to have generated these files as-is in the repo because not all devs are able to regenerate them (i.e. no license for a tool).
> >
> >     If there are no special cases which need special treatment (which would go into .gitattributes), maybe it's sufficient to have a core.autocrlf=false or input in the local repo (no --global).
> >
> >     Further reading:
> >     https://docs.github.com/en/github/using-git/configuring-git-to-handle-line-endings <https://docs.github.com/en/github/using-git/configuring-git-to-handle-line-endings> <https://docs.github.com/en/github/using-git/configuring-git-to-handle-line-endings <https://docs.github.com/en/github/using-git/configuring-git-to-handle-line-endings>>
> >     > > To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com <mailto:openpnp%2Bu...@googlegroups.com> <mailto:openpnp+u...@googlegroups.com <mailto:openpnp%2Bu...@googlegroups.com>>.
> >     > > To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com> <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com>> <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com> <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com>>>
> <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com?utm_medium=email&utm_source=footer> <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com?utm_medium=email&utm_source=footer>> <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com?utm_medium=email&utm_source=footer>
> >     <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/openpnp/8e1dfaeb-ff49-4510-871e-4743d0ea9e9an%40googlegroups.com?utm_medium=email&utm_source=footer>>>>.
> >     > >
> >     > > --
> >     > > Sent from my BeOS enabled toaster
> >     > >
> >     > > --
> >     > > You received this message because you are subscribed to the Google Groups "OpenPnP" group.
> >     > > To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com <mailto:openpnp%2Bu...@googlegroups.com> <mailto:openpnp+u...@googlegroups.com <mailto:openpnp%2Bu...@googlegroups.com>>.
> >     > > To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com> <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com>> <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com> <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com>>>
> <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com?utm_medium=email&utm_source=footer> <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com?utm_medium=email&utm_source=footer>> <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwCXS2JZkRukHNpepDag39T_w4Z1vZv%3Dt765ZLupVaRvQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> >     > To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com <mailto:openpnp%2Bu...@googlegroups.com>.
> >     > To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/10c0f3f6-7fb7-4eb0-86dd-6e6dd0b7efb9n%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/10c0f3f6-7fb7-4eb0-86dd-6e6dd0b7efb9n%40googlegroups.com> <https://groups.google.com/d/msgid/openpnp/10c0f3f6-7fb7-4eb0-86dd-6e6dd0b7efb9n%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/10c0f3f6-7fb7-4eb0-86dd-6e6dd0b7efb9n%40googlegroups.com>> <https://groups.google.com/d/msgid/openpnp/10c0f3f6-7fb7-4eb0-86dd-6e6dd0b7efb9n%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/openpnp/10c0f3f6-7fb7-4eb0-86dd-6e6dd0b7efb9n%40googlegroups.com?utm_medium=email&utm_source=footer> <https://groups.google.com/d/msgid/openpnp/10c0f3f6-7fb7-4eb0-86dd-6e6dd0b7efb9n%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/openpnp/10c0f3f6-7fb7-4eb0-86dd-6e6dd0b7efb9n%40googlegroups.com?utm_medium=email&utm_source=footer>>>.
> >     >
> >     > --
> >     > You received this message because you are subscribed to the Google Groups "OpenPnP" group.
> >     > To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com <mailto:openpnp%2Bu...@googlegroups.com> <mailto:openpnp+u...@googlegroups.com <mailto:openpnp%2Bu...@googlegroups.com>>.
> >     > To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/1ee86163-7e64-4451-82f8-e182a4d1e938n%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/1ee86163-7e64-4451-82f8-e182a4d1e938n%40googlegroups.com> <https://groups.google.com/d/msgid/openpnp/1ee86163-7e64-4451-82f8-e182a4d1e938n%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/1ee86163-7e64-4451-82f8-e182a4d1e938n%40googlegroups.com>> <https://groups.google.com/d/msgid/openpnp/1ee86163-7e64-4451-82f8-e182a4d1e938n%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/openpnp/1ee86163-7e64-4451-82f8-e182a4d1e938n%40googlegroups.com?utm_medium=email&utm_source=footer> <https://groups.google.com/d/msgid/openpnp/1ee86163-7e64-4451-82f8-e182a4d1e938n%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/openpnp/1ee86163-7e64-4451-82f8-e182a4d1e938n%40googlegroups.com?utm_medium=email&utm_source=footer>>>.
> >     >
> >     > --
> >     > You received this message because you are subscribed to the Google Groups "OpenPnP" group.
> >     > To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com <mailto:openpnp%2Bu...@googlegroups.com> <mailto:openpnp+u...@googlegroups.com <mailto:openpnp%2Bu...@googlegroups.com>>.
> >     > To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CADmm%2BKeuRw8s35Etnh-cYZvkeatdGPDMSU1Wngft6Q_tH67HNQ%40mail.gmail.com <https://groups.google.com/d/msgid/openpnp/CADmm%2BKeuRw8s35Etnh-cYZvkeatdGPDMSU1Wngft6Q_tH67HNQ%40mail.gmail.com> <https://groups.google.com/d/msgid/openpnp/CADmm%2BKeuRw8s35Etnh-cYZvkeatdGPDMSU1Wngft6Q_tH67HNQ%40mail.gmail.com <https://groups.google.com/d/msgid/openpnp/CADmm%2BKeuRw8s35Etnh-cYZvkeatdGPDMSU1Wngft6Q_tH67HNQ%40mail.gmail.com>> <https://groups.google.com/d/msgid/openpnp/CADmm%2BKeuRw8s35Etnh-cYZvkeatdGPDMSU1Wngft6Q_tH67HNQ%40mail.gmail.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/openpnp/CADmm%2BKeuRw8s35Etnh-cYZvkeatdGPDMSU1Wngft6Q_tH67HNQ%40mail.gmail.com?utm_medium=email&utm_source=footer> <https://groups.google.com/d/msgid/openpnp/CADmm%2BKeuRw8s35Etnh-cYZvkeatdGPDMSU1Wngft6Q_tH67HNQ%40mail.gmail.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/openpnp/CADmm%2BKeuRw8s35Etnh-cYZvkeatdGPDMSU1Wngft6Q_tH67HNQ%40mail.gmail.com?utm_medium=email&utm_source=footer>>>.
> >
> > --
> > You received this message because you are subscribed to the Google Groups "OpenPnP" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com <mailto:openpnp%2Bunsu...@googlegroups.com> <mailto:openpnp+u...@googlegroups.com <mailto:openpnp%2Bunsu...@googlegroups.com>>.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/dc859c08-b011-4090-9697-af426ed5889an%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/dc859c08-b011-4090-9697-af426ed5889an%40googlegroups.com> <https://groups.google.com/d/msgid/openpnp/dc859c08-b011-4090-9697-af426ed5889an%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/openpnp/dc859c08-b011-4090-9697-af426ed5889an%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
> --
> You received this message because you are subscribed to the Google Groups "OpenPnP" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com <mailto:openpnp%2Bunsu...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/ba88ef4e-5b20-3f18-df5c-1dc7aa0f058a%40gmx.net <https://groups.google.com/d/msgid/openpnp/ba88ef4e-5b20-3f18-df5c-1dc7aa0f058a%40gmx.net>.
>
> --
> You received this message because you are subscribed to the Google Groups "OpenPnP" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com <mailto:openpnp+u...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CA%2BQw0jx_jsufuMTYQBij2T%3DOP5pTDrKKAnNtEtuvW2323HPD0Q%40mail.gmail.com <https://groups.google.com/d/msgid/openpnp/CA%2BQw0jx_jsufuMTYQBij2T%3DOP5pTDrKKAnNtEtuvW2323HPD0Q%40mail.gmail.com?utm_medium=email&utm_source=footer>.

tonyl...@gmail.com

unread,
Aug 31, 2021, 11:51:17 AM8/31/21
to OpenPnP
I just checked the develop branch and it now has 73  *.java files with CRLF line endings and the test branch has 76.  See the attached lists.  Is the preventative as easy as adding this to the POM? https://stackoverflow.com/questions/15003871/how-to-make-maven-checking-the-source-end-of-line
badFilesInDevelop.txt
badFilesInTest.txt

ma...@makr.zone

unread,
Aug 31, 2021, 12:23:56 PM8/31/21
to OpenPnP
Good find. Unfortunately, I have no idea about Checkstyle and I think it is currently broken in mvn test anyway!

If someone with Java / Maven / Checkstyle experience could help, this would be great!

Thanks!

_Mark

tonyl...@gmail.com

unread,
Aug 31, 2021, 12:44:17 PM8/31/21
to OpenPnP
Actually Checkstyle seems to be working now - at least it found a couple of variables of mine that didn't follow the guidelines plus a couple of places where I didn't have braces on if statements and it failed the build process (see https://github.com/tonyluken/openpnp/runs/3466854326?check_suite_focus=true).  I see in the pom where that is done so I assume we can just add the check in that same place; but, like you I'm not at all familiar with Checkstyle other than what I've learned in a few minute of Googling.

tonyl...@gmail.com

unread,
Sep 1, 2021, 12:33:22 PM9/1/21
to OpenPnP
In case anyone is interested, I tried modifying the pom and it does appear to fail the build on the files with CRLF line endings - see:   https://github.com/tonyluken/openpnp/runs/3486698251?check_suite_focus=true

I think we may still want to add a .gitattributes file to the project as well though just so that when files are checked-out, they keep their LF line endings.  Otherwise, if someone on a Windows machine with autocrlf=true will not be able to run the Maven test without it showing all files as having CRLF endings.

tonyl...@gmail.com

unread,
Sep 1, 2021, 4:53:52 PM9/1/21
to OpenPnP
I believe I got this working so I submitted PR  #1275
Reply all
Reply to author
Forward
0 new messages