tuxji commented on a change in pull request #681:
URL: https://github.com/apache/daffodil/pull/681#discussion_r752428829
##########
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:
Steve, I just saw your comments. Yes, your sbt code works around the
version issue, but so does running the unit test with "sbt test" without
needing any changes to build.sbt. I think having a unit test is nice because
it offers a way to quickly test and debug changes to the code generator using a
couple of larger example schemas.
And yes, your generator changes look like they would allow the test to pass
regardless of which line endings the git checkout uses. However, there are a
lot of multiline strings in runtime2 and we would need to make these
`stripMargin.replace("\r\n", "\n")` changes to every place. I think it's a lot
easier and simpler to add one line in .gitattributes telling git to check out
all of daffodil-runtime as LF regardless of platform or git config settings.
However, I need a second+1 anyway, so Mike (@mbeckerle), will you please tell
us which way you prefer?
I also wonder which would give us fewer problems in the long run, telling
git to check out all of daffodil as LF with `* text=auto eol=LF` or continuing
to call `if (windows)`, `replace("\r\n", "\n")`, `replace("\n",
System.lineSeparator)`, `mkString(System.lineSeparator)`, and so on. I suspect
it's probably not worth making major changes to line separators in files or
code and we should keep changing as few files and lines of code as possible.
The tests have all passed now, so I think checking out daffodil-runtime2 as LF
without changing any other part of daffodil has the least risk and will spare
daffodil-runtime2 from needing explicit code to manage line separators in the
future.
--
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]