dotnet / templating

This repo contains the Template Engine which is used by dotnet new
https://docs.microsoft.com/dotnet/
MIT License
1.63k stars 369 forks source link

IDE 0044 and IDE 1006 making private static field PascalCase #4144

Open tthiery opened 2 years ago

tthiery commented 2 years ago

Version Used: .NET 6.0.100

Steps to Reproduce:

  1. Editor Config from .NET 6 dotnet new editorconfig
  2. Define something like private static Lazy<Dictionary<Type, Type>> s_lazyConverters = new( ... )
  3. Compiler throws IDE0044 (make readonly) .. okay makes sense ... change private static readonly Lazy<Dictionary<Type, Type>> s_lazyConverters = new( ... )
  4. Compiler throws IDE1006 (unexpected s_) ... IMHO: Bug .. changes to this private static readonly Lazy<Dictionary<Type, Type>> LazyConverters = new( .. )

Expected Behavior: A private field remains camelCase / s_camelCase

Actual Behavior: A private field ended up PascalCase

jmarolf commented 2 years ago

moved this to https://github.com/dotnet/templating as that is where the template lives but keeping myself assigned as I investigate this.

YuliiaKovalova commented 1 year ago

@arkalyanms do you have any ideas on how to manage it?