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

Feature request: .editorconfig supports commas at end of certain members #21151

Closed
heaths opened this issue Jul 26, 2017 · 5 comments
Closed

Comments

@heaths
Copy link

heaths commented Jul 26, 2017

To reduce the complexity of diffs (and merges with said diffs), we prefer developers use commas after the last member of enums, and object and collection initializers like so:

enum ExampleEnum
{
  Foo,
  Bar,
}

new ExampleClass
{
  Foo = 1,
  Bar = "str",
}

new[]
{
  "foo",
  "bar",
}

It would be great if .editorconfig supported commas in these cases, as mere suggestions, required, or forbidden as with other rules.

@Pilchie Pilchie added this to the Unknown milestone Jul 27, 2017
@Pilchie
Copy link
Member

Pilchie commented Jul 27, 2017

Nice suggestion! Also tagging @kuhlenh and adding it to our backlog.

@sharwell
Copy link
Member

sharwell commented Jul 27, 2017

📝 An implementation of this style rule is currently available in StyleCop Analyzers. It proved fairly contentious, e.g. DotNetAnalyzers/StyleCopAnalyzers#2416, with rationale added in DotNetAnalyzers/StyleCopAnalyzers#2418.

@heaths
Copy link
Author

heaths commented Jul 28, 2017

@sharwell I see from the code it works for object, array, and collection initializers. Does that apply to enumeration declarations as well?

@sharwell
Copy link
Member

@heaths As of DotNetAnalyzers/StyleCopAnalyzers#2239 it does 😄

@CyrusNajmabadi
Copy link
Member

Closing as external. StyleCop handles this.

@CyrusNajmabadi CyrusNajmabadi closed this as not planned Won't fix, can't repro, duplicate, stale Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants