stevedlawrence commented on a change in pull request #681:
URL: https://github.com/apache/daffodil/pull/681#discussion_r752337305



##########
File path: .gitattributes
##########
@@ -13,4 +13,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+# Do not include KEYS in archived source releases
 /KEYS export-ignore 
+
+# Do not convert to CRLF on Windows since tests require LF files
+/**/runtime2/examples/** text=auto eol=lf

Review comment:
       Ugh, git mangling newlines has brought us so many problems.
   
   That said, right now the generator is not consistent about multline strings, 
since depending on git mangling they could have CR or CRLF. I wonder if our 
multiline strings need something like this:
   
   ```scala
   val foo = 
     "|some
      |multiline
      |string".stripMargin.replace("\r\n", "\n")
   ```
   
   So that we always output LF regardless of where daffodil is built and what 
mangling git does?
   
   Also, I wonder if we should consider outputting as the preferred OS 
line-separator, e.g.
   
   ```scala
   val foo = 
     "|some
      |multiline
      |string".stripMargin.replace("\r\n", "\n").replace("\n", 
System.lineSeparator)
   val bar = Seq("some", "multline", "string").mkString(System.lineSeparator)
   ```
   If we do this and output the system line separator, I *think* things should 
just work without needing this .gitattributes line? And it has the benefit that 
people get code that has newlines matching their system.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to