belav / csharpier

CSharpier is an opinionated code formatter for c#.
https://csharpier.com
MIT License
1.32k stars 89 forks source link

Possible indentation change for array initializers #658

Open belav opened 2 years ago

belav commented 2 years ago

These two indent differently based on the constructor call, maybe they should indent consistently.


        private static HashSet<string> ignoredFileNames = new HashSet<string>(
            StringComparer.OrdinalIgnoreCase
        )
        {
            "antlr.runtime.dll",
            "Antlr3.Runtime.dll",
            "AuthorizeNet.dll"
        };
// vs
        private static HashSet<string> ignoredFileNames =
            new(StringComparer.OrdinalIgnoreCase)
            {
                "antlr.runtime.dll",
                "Antlr3.Runtime.dll",
                "AuthorizeNet.dll",
commonquail commented 1 year ago

You may want to look at https://github.com/google/google-java-format/wiki/The-Rectangle-Rule. That design principle is a major factor in churn reduction around assignments by google-java-format, and conversely Prettier not using it (and by indirect extension CSharpier) generates churn. See also #765.