[JAVA-2749] CheckStyle error: File does not end with a newline (Windows vs Unix) Created: 24/Jan/18  Updated: 28/Oct/23  Resolved: 25/Jan/18

Status: Closed
Project: Java Driver
Component/s: Build
Affects Version/s: None
Fix Version/s: 3.7.0

Type: Improvement Priority: Major - P3
Reporter: Farès Hassak Assignee: Ross Lawley
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File checkstyleError.png    

 Description   

Hello,

There is a checkStyle error when i build master branch on Windows : File does not end with a newline.

By default, checkstyle use the system line separator.
I checkout code from unix system and build on windows.
Or, line separator are different.

So, configure checkstyle to use "crlf" (Windows-style), "cr" (Mac-style), "lf" (Unix-style)

http://checkstyle.sourceforge.net/config_misc.html#NewlineAtEndOfFile

<module name="NewlineAtEndOfFile">
        <property name="lineSeparator" value="lf_cr_crlf" />
    </module>

Build is success on windows with this configuration

Farès



 Comments   
Comment by Githook User [ 25/Jan/18 ]

Author:

{'name': 'Farès Hassak', 'email': 'fares.hassak@gmail.com', 'username': 'fhassak'}

Message: JAVA-2749 : configure checkstyle to use Windows or Mac or Unix line separator
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/10b93fe1a196ff90ad76f87e719ecfcb97e19c54

Comment by Farès Hassak [ 24/Jan/18 ]

FYI, error is in class mongo-java-driver\driver-legacy\src\main\com\mongodb\Mongo.java

This class already contains a new line at the end of the file (unix-style) and checkstyle, by default, use system line separator (windows-style for me)...

Comment by Farès Hassak [ 24/Jan/18 ]

https://github.com/mongodb/mongo-java-driver/pull/444

Generated at Thu Feb 08 08:57:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.