Fix CRLF/LF problems for Windows dev #270
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes the following CRLF/LF problems for Windows dev. (only affects test documents)
Test suites
On Windows,
git clone
may automatically convert LF to CRLF. (Seegit config core.autocrlf
.)For tests expecting multiple lines, the RESULT section will get corrupted, leading to tons of failures.
For example,
https://github.com/citation-style-language/test-suite/blob/d2bd47ff09db6e2995aeed2be0b096b12c0f8f70/processor-tests/humans/variables_TitleShortOnShortTitleNoTitleGroup.txt#L5-L9
truncated output of
git clone … && cargo test --features csl-json
on WindowsReason:
test_file
uses LF foroutput
, but the RESULT section uses CRLF forexpected
:hayagriva/tests/citeproc.rs
Line 585 in af5c146
To fix it, I replace all CRLF in the RESULT section with LF.
CBOR and CSL/XML
Git does not natively recognize
*.cbor
, and guesses their types (text/binary) based on their content.If git misclassifies a CBOR as binary, it will corrupt it by altering end-of-line.
For example, the following
<summary>
containing newlines will be literally embedded in CBOR.https://github.com/citation-style-language/styles/blob/2e90b3afc1aa6fc90c46d674798936cd438af1fa/spie-journals.csl#L16-L19
To fix it, I explicitly mark
*.cbor
as binary in.gitattributes
, and freeze end-of-line of CSL/XML.Relates-to: tafia/quick-xml#454