Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SA1137 picks the wrong starting indentation #3874

Open
manfred-brands opened this issue Jul 10, 2024 · 0 comments
Open

SA1137 picks the wrong starting indentation #3874

manfred-brands opened this issue Jul 10, 2024 · 0 comments

Comments

@manfred-brands
Copy link

In various fixes, where the first field in a class had the wrong indentation, the codefix modified the whole class instead of indenting the first field.

namespace MySpace
{
    internal sealed class SomeClass
    {
      internal const string Name = "Name";

        private readonly Dictionary<string, object> m_Cache;

        private SomeClass()
        {
            // Some code
        }
    }
}

The code fix change the indentation of the other field and the following properties/method to match the first.
It however did not change the indentation of the code blocks.

namespace MySpace
{
    internal sealed class SomeClass
    {
      internal const string Name = "Name";

      private readonly Dictionary<string, object> m_Cache;

      private SomeClass()
        {
            // Some code
        }
    }
}

Can the rule not use the .editorconfig indent_size=4 information to figure out which indentation is wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant