Download Latest Version 1.1.1 source code.tar.gz (898.3 kB)
Email in envelope

Get an email when there's a new version of CSharpier

Home / 1.1.0
Name Modified Size InfoDownloads / Week
Parent folder
csharpier.1.1.0.nupkg 2025-08-03 19.3 MB
1.1.0 source code.tar.gz 2025-08-03 898.1 kB
1.1.0 source code.zip 2025-08-03 1.3 MB
README.md 2025-08-03 6.7 kB
Totals: 4 Items   21.4 MB 0

What's Changed

.gitignore from parent folders impacts formatting of children #1627

CSharpier will no longer consider .gitignore files located above the root of the current git repository.

Changes to stdin formatting #288 #1657

There is a new option --stdin-filepath that is used to specify the filepath CSharpier should use for resolving options and ignore files. \ When no path is specified via stdin-path - No ignore files are considered. - The current directory is considered when locating options - The file is assumed to be c# unless the first non-whitespace character is < in which case it is assumed to be xml.

Support for C# 14 and .NET 10 #1654 #1646

Changes were required to support the following - Extension Declarations - File level directives in file based C# Apps

Support --ignore-path CLI option #1585

It is now possible to specify the path to an ignore file

:::bash
dotnet csharpier format . --ignore-path .config/.csharpierignore

Format xaml and slnx by default #1628 #1604

CSharpier now formats xaml and slnx by default without the need for configuration changes.

XML formatting is not taking into account EOL configuration on multiline comments #1660

When formatting the following XML, CSharpier would always use the system system default for ending lines within the comment instead of the respecting the configured EOL setting.

:::xml
<Element>
  <!--
  Comment with EOL
  -->
</Element>

Error when no read access to intermediate containing folder #1656

In the case that CSharpier had access to a sub directory but not the parent of that sub directory, it was failing with an exception. That has been resolved.

Misleading message after "csharpier check" #1645

Previously the format and check commands both used the same output message. The check command now correctly reports that it checked files and did not format them.

:::bash
# 1.0.3
dotnet csharpier check .
Formatted 13226 files in 21986ms.

# 1.1.0
dotnet csharpier check .
Checked 13226 files in 21986ms.

Multiline collection expressions should not be indented #1635

CSharpier now formats collection expressions consistently when they are in a property

:::c#
// input & expected output
public class ClassName
{
    public SomeObject LongValue = new
    {
        One = "One",
        Two = "Two",
        ThreeThreeThree = "ThreeThreeThree",
    };

    public SomeObject LongValue { get; } = new
    {
        One = "One",
        Two = "Two",
        ThreeThreeThree = "ThreeThreeThree",
    };
}

// 1.0.3
public class ClassName
{
    public SomeObject LongValue = new
    {
        One = "One",
        Two = "Two",
        ThreeThreeThree = "ThreeThreeThree",
    };

    public SomeObject LongValue { get; } =
        new
        {
            One = "One",
            Two = "Two",
            ThreeThreeThree = "ThreeThreeThree",
        };
}

.editorconfig is not considered, when its part of the .gitignore #1582

Previously if an .editorconfig was in the .gitignore it would not be considered when determining the configuration options for formatting a given file. That behavior has been changed so it will be considered.

Full Changelog: https://github.com/belav/csharpier/compare/1.0.3...1.1.0

1.0.3

What's Changed

Switch block case with conditionals adding newlines #1630

Switch blocks were breaking on conditions within patterns.

:::c#
// input and expected output
switch ("")
{
    case "" or "":
        break;
}

// 1.0.2
switch ("")
{
    case ""
    or "":
        break;
}

switch expression formatting adds odd newlines #1620

CSharpier was breaking after a discard with a when, resulting in extra new lines

:::c#
// input and expected output
_ = someValue switch
{
    _ when KeepWhenWithDiscard() => "",
    _ when KeepWhenWithDiscard_________________(
            SomeObject_______________________________________________
        ) => "",
    _ when KeepWhenWithDiscard_________________(
            SomeObject_______________________________________________
        ) => "LongString_____________________________________________________________________",
};

// 1.0.2
_ = someValue switch
{
    _ when KeepWhenWithDiscard() => "",
    _
        when KeepWhenWithDiscard_________________(
            SomeObject_______________________________________________
        ) => "",
    _
        when KeepWhenWithDiscard_________________(
            SomeObject_______________________________________________
        ) => "LongString_____________________________________________________________________",
};

multi-line raw string in linq query causes a subsequent linq query to be printed on one line #1617

If a query syntax linq expression contained a raw string, it could result in method invocations not breaking.

:::c#
// input and expected output
(
    from x in SomeMethod()
    select """
        someString
        """
)
    .CallMethod_____________________________________________()
    .CallMethod_____________________________________________();

// 1.0.2
(
    from x in SomeMethod()
    select """
        someString
        """
).CallMethod_____________________________________________().CallMethod_____________________________________________();

Full Changelog: https://github.com/belav/csharpier/compare/1.0.2...1.0.3

Source: README.md, updated 2025-08-03