Repository navigation
Issue #18619: Add expected separator to NewlineAtEndOfFileCheck violation - #18972
Conversation
|
Hi @romani, Added Thank you. |
|
please make PR ready for review. |
8a0f16e to
7759199
Compare
|
Hi @romani, |
|
@mdhamed238 , please continue this PR also. |
0a0c088 to
beaa740
Compare
romani
left a comment
There was a problem hiding this comment.
@mahfouz72 will do deeper look
after quick look:
beaa740 to
e98aeda
Compare
abf0996 to
1a54394
Compare
85c1db8 to
fec37a7
Compare
c5ef63e to
24c9517
Compare
1afbbe2 to
23a9594
Compare
23a9594 to
bba6471
Compare
|
GitHub, generate website |
|
|
|
hmm, please make code at XdocsPagesTest.validateExampleSectionSeparation to exclude this newlineatendoffile Example4-6 from from this validation, it is exceptional case, we group them as represent the same config but different files. |
|
Github, generate report for NewlineAtEndOfFile/Example3 |
bba6471 to
48e8421
Compare
…heck violation message
48e8421 to
86af391
Compare
|
Hi @romani, |
|
I see that 4 commits have been merged into master in the meantime. Even though there's no conflict, should I rebase with master again? |
only before next push to GitHub from your side (usually happens when you do extra chnage). |
|
GitHub, generate website |
Issue: #18619
Problem:
When
lineSeparatoris set tolf,cr, orcrlfand a file does not end withthe expected separator (e.g. ends with CR when LF is expected, or has no newline at
all), the check emitted the generic message "File does not end with a newline." — giving
no indication of what separator was actually expected. This was misleading, especially
when the file does end with some newline, just not the right kind.
Fix:
Added a new message key
noNewlineAtEOFWithSeparator("File does not end with anewline '{0}'.") used when
lineSeparatoris one of the specific options:lf,cr,or
crlf. The originalnoNewlineAtEOF("File does not end with a newline.") ispreserved for the generic options
lf_cr_crlf(default) andsystem, where naming aspecific separator in the message would be misleading. All 9 locale message files were
updated with translations of the new key.
Testing:
Updated
NewlineAtEndOfFileCheckTest#testCrEndingWhenLfExpectedandtestNoNewlineLfAtEndOfFileto assert the new parameterized message. AddedExample7.java(crseparator, no newline) andExample8.java(crlfseparator,no newline) with corresponding
testExample7andtestExample8inNewlineAtEndOfFileCheckExamplesTest, covering the two previously untestedviolation paths for
crandcrlfseparators.