Kalle Niemitalo created AVRO-3562:
-------------------------------------

             Summary: .NET/C# avrogen newline normalization in comments
                 Key: AVRO-3562
                 URL: https://issues.apache.org/jira/browse/AVRO-3562
             Project: Apache Avro
          Issue Type: Improvement
          Components: csharp, tools
    Affects Versions: 1.11.0
            Reporter: Kalle Niemitalo


The C# avrogen tool generates C# comments from the "doc" properties of types 
and fields. If the values of those comments contain newline characters written 
as "\n" in the JSON avsc file, then avrogen copies those LF characters into the 
comments. However, when avrogen is used in Windows, all the other lines in the 
generated C# file end with CRLF. So the file has a mix of LF and CRLF. This 
causes warnings from Visual Studio, and possibly from Git if "core.safecrlf" 
has been set.

It would be better if avrogen normalized the newlines in the C# comments to 
match the rest of the generated C# file.

This change should be made only to the generated comments. The 
NamedSchema.Documentation and Field.Documentation properties, and the 
Schema.ToString() method, should not normalize the newlines within 
documentation. Likewise, the JSON string literals within the {{public static 
Schema _SCHEMA = Avro.Schema.Parse(…);}} fields should have the \r and \n 
characters as in the schema file.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to