[
https://issues.apache.org/jira/browse/MCHECKSTYLE-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16843199#comment-16843199
]
Roman Ivanov edited comment on MCHECKSTYLE-376 at 5/18/19 4:59 PM:
-------------------------------------------------------------------
8.19 version
Use default config of Check,
https://github.com/checkstyle/checkstyle/blob/checkstyle-8.19/src/main/resources/sun_checks.xml#L56
Documentation state
http://checkstyle.sourceforge.net/version/8.19/config_misc.html#NewlineAtEndOfFile
that default value of lineSeparator is system.
It was like this even in old version
http://checkstyle.sourceforge.net/version/6.18/config_misc.html#NewlineAtEndOfFile
I do not see any recent behavior changes in this Check -
https://github.com/checkstyle/checkstyle/commits/a73ff0890c27cbe8affc1a55f2710a231687bd85/src/main/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheck.java
file
https://github.com/apache/maven-checkstyle-plugin/blob/master/src/it/MCHECKSTYLE-54/src/main/java/org/apache/maven/plugins/checkstyle/mcheckstyle54/Mcheckstyle54.java
is recent changes in plugin
Issue is definitely in the way sources are cloned, we had the same problem, and
created help page on how to configure git on windows before clone
https://checkstyle.org/beginning_development.html#Before_development
But checkstyle library can improve message to be exact on expected symbol
"NewlineAtEndOfFile: File does not end with a newline" to be
"NewlineAtEndOfFile: File does not end with a newline #0D0A# for example.
was (Author: romani):
8.19 version
Use default config of Check,
https://github.com/checkstyle/checkstyle/blob/checkstyle-8.19/src/main/resources/sun_checks.xml#L56
Documentation state
http://checkstyle.sourceforge.net/version/8.19/config_misc.html#NewlineAtEndOfFile
that default value of lineSeparator is system.
It was like this even in old version
http://checkstyle.sourceforge.net/version/6.18/config_misc.html#NewlineAtEndOfFile
I do not see any recent behavior changes in this Check -
https://github.com/checkstyle/checkstyle/commits/a73ff0890c27cbe8affc1a55f2710a231687bd85/src/main/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheck.java
file
https://github.com/apache/maven-checkstyle-plugin/blob/master/src/it/MCHECKSTYLE-54/src/main/java/org/apache/maven/plugins/checkstyle/mcheckstyle54/Mcheckstyle54.java
is recent changes in plugin
> The IT fails MCHECKSTYLE-54 (Unix EOL files). Broken rule
> 'NewlineAtEndOfFile' on Windows.
> ------------------------------------------------------------------------------------------
>
> Key: MCHECKSTYLE-376
> URL: https://issues.apache.org/jira/browse/MCHECKSTYLE-376
> Project: Maven Checkstyle Plugin
> Issue Type: Improvement
> Components: checkstyle:check
> Reporter: Tibor Digana
> Priority: Major
> Attachments: linux.zip, windows.zip
>
>
> Afects version 3.1.0 during the release vote.
> It looks like the library expects system based EOL character.
> The checkstyle reports the issue in two files in
> https://github.com/apache/maven-checkstyle-plugin/tree/master/src/it/MCHECKSTYLE-54/src/main/java/org/apache/maven/plugins/checkstyle/mcheckstyle54
> I doubt it is a problem with these two files, nothing but the library itself.
> No idea why other ITs do not fail on Windows too.
> {noformat}
> mvn -nsu checkstyle:check
> [INFO] --- maven-checkstyle-plugin:3.1.1-SNAPSHOT:check (default-cli) @
> mcheckstyle-54 ---
> [INFO] There are 2 errors reported by Checkstyle 8.19 with sun_checks.xml
> ruleset.
> [ERROR]
> src\main\java\org\apache\maven\plugins\checkstyle\mcheckstyle54\Mcheckstyle54.java:[1]
> (misc) NewlineAtEndOfFile: File does not end with a newline.
> [ERROR]
> src\main\java\org\apache\maven\plugins\checkstyle\mcheckstyle54\package-info.java:[1]
> (misc) NewlineAtEndOfFile: File does not end with a newline.
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 3.450 s
> [INFO] Finished at: 2019-05-13T23:42:55+02:00
> [INFO] Final Memory: 12M/193M
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-checkstyle-plugin:3.1.1-SNAPSHOT:check
> (default-cli) on project mcheckstyle-54: You have 2 Checkstyle violations. ->
> [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 possible solutions, please
> read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)