#StackBounty: #c# #.net #visual-studio #editorconfig Formatting rule to have blank line between class member declarations

Bounty: 50

Micrsoft provides bunch of coding settings for EditorConfig
.NET coding convention settings for EditorConfig

But cannot find the way to create a rule, which will suggest developer to add empty line between class members declaration.

// "Bad" style
public class Order
{
    private readonly IRepository _repository;
    private readonly IPriceCalculator _priceCalculator;
    public Order(IRepository repository, IPriceCalculator priceCalculator)
    {
        _repostitory = repository;
        _priceCalculator = priceCalculator;
    }
    public CopyFrom(Order originalOrder)
    {
        // Create new order
    }
    public Cancel(Customer customer)
    {
        // Cancel order
    }
}

// Good style
public class Order
{
    private readonly IRepository _repository;

    private readonly IPriceCalculator _priceCalculator;

    public Order(IRepository repository, IPriceCalculator priceCalculator)
    {
        _repostitory = repository;
        _priceCalculator = priceCalculator;
    }

    public CopyFrom(Order originalOrder)
    {
        // Create new order
    }

    public Cancel(Customer customer)
    {
        // Cancel order
    }
}


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.