Root-level settings design

Developer
May 28, 2010 at 11:14 PM

Dear Jason,

I have a conceptual question about settings and would like to ask you to clarify some points, if you don't mind.

When we are editing local settings (that merge/override the root ones), we have the following behaviour:
- Changed (at this level) settings are displayed as bold
- Changed (at this level) settings are saved in current-level config

But when we are editing root settings we have the different behaviour:
- When change settings, they began being displayed as bold
- When we save them, they are being written into root-level config
- When we open them for the second time - they aren't displayed as bold any more

(In fact, there are some bugs in editing root settings, but let's not to pay attention to them right now. I'm trying to understand the whole idea) 

As I understand StyleCop's settings architecture, we can distinguish the following levels:
- default values (defined in analyzer assembly)
- root config
- local config 1
- local config 2
- ...

When we open the epmty root config file - we see default settings (actually taken out from assembly).

So don't you think that it would be nice to always show settings as bold if they defined in current-level config (even it is a root config)?
In other words, to display all non-default settings as bold when editing root config (in fact, it already works in this way for local configs, but not for the root one). 

Thanks in advance!

P.S. Just let me know if I failed to express my idea in a understandable way. 

Best regards,
Oleg Shuruev 

May 29, 2010 at 12:14 AM

Bold is specifically meant to indicate that you are overriding the default setting. This is similar to how bold works in the Visual Studio Properties window.

From: shuruev [mailto:notifications@codeplex.com]
Sent: Friday, May 28, 2010 3:14 PM
To: Jason Allor
Subject: Root-level settings design [stylecop:214265]

From: shuruev

Dear Jason,

I have a conceptual question about settings and would like to ask you to clarify some points, if you don't mind.

When we are editing local settings (that merge/override the root ones), we have the following behaviour:
- Changed (at this level) settings are displayed as bold
- Changed (at this level) settings are saved in current-level config

But when we are editing root settings we have the different behaviour:
- When change settings, they began being displayed as bold
- When we save them, they are being written into root-level config
- When we open them for the second time - they aren't displayed as bold any more

(In fact, there are some bugs in editing root settings, but let's not to pay attention to them right now. I'm trying to understand the whole idea)

As I understand StyleCop's settings architecture, we can distinguish the following levels:
- default values (defined in analyzer assembly)
- root config
- local config 1
- local config 2
- ...

When we open the epmty root config file - we see default settings (actually taken out from assembly).

So don't you think that it would be nice to always show settings as bold if they defined in current-level config (even it is a root config)?
In other words, to display all non-default settings as bold when editing root config (in fact, it already works in this way for local configs, but not for the root one).

Thanks in advance!

P.S. Just let me know if I failed to express my idea in a understandable way.

Best regards,
Oleg Shuruev

Read the full discussion online.

To add a post to this discussion, reply to this email (stylecop@discussions.codeplex.com)

To start a new discussion for this project, email stylecop@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Developer
May 29, 2010 at 9:49 AM
Edited May 29, 2010 at 9:54 AM

Bold is specifically meant to indicate that you are overriding the default setting. This is similar to how bold works in the Visual Studio Properties window.

Yes, that is just what I mean - the bold is intended to work this way. The problem is that bold doesn't work this way when we edit root config (placed in StyleCop folder).

Let me be more specific:

Image that we have analyzer with two settings (pseudo-syntax, ok?):
<Settings>
····<Setting Name="SettingA" DefaultValue="False" />
····<Setting Name="SettingB" DefaultValue="False" />
</Settings>

Then let's see how they're displayed:

Setting file location and contents How it is displayed now How I suggest displaying it
C:\Program Files\Microsoft StyleCop 4.4.0.9\
("root config")
<Settings>
····<Setting Name="SettingA" Value="True">
</Settings>
 
[ x ] SettingA
[    ] SettingB
[ x ] SettingA
[    ] SettingB
D:\Projects\
("local config level 1")
<Settings>
····<Setting Name="SettingB" Value="True">
</Settings> 
 
[ x ] SettingA
[ x ] SettingB
[ x ] SettingA
[ x ] SettingB
D:\Projects\MyProject\
("local config level 2")
<Settings>
</Settings> 
 
[ x ] SettingA
[ x ] SettingB
[ x ] SettingA
[ x ] SettingB

If we look at the first row, we will see that root config settings are never displayed in bold (although they differ from default values, defined in analyzer's assembly).
And I see a little inconsistency in it. (In fact, I suspect that it is a reason for various bug during root config editing - that is why I've decided to understand your intensions more deeply).

So, could you somehow comment this behaviour?

Thanks for paying attention!

Best regards,
Oleg Shuruev

Jun 1, 2010 at 6:31 PM

I think I see what you’re saying. You’re talking about the default settings that an analyzer will use if there are no settings at all specified in any settings files. You could create a new feature request and move the contents of this discussion there.

From: shuruev [mailto:notifications@codeplex.com]
Sent: Saturday, May 29, 2010 1:50 AM
To: Jason Allor
Subject: Re: Root-level settings design [stylecop:214265]

From: shuruev

Bold is specifically meant to indicate that you are overriding the default setting. This is similar to how bold works in the Visual Studio Properties window.

Yes, that is just what I mean - the bold is intended to work this way. The problem is that bold doesn't work this way when we edit root config (placed in StyleCop folder).

Let me be more specific:

Image that we have analyzer with two settings (pseudo-syntax, ok?):
<Settings>
····<Setting Name="SettingA" DefaultValue="False" />
····<Setting Name="SettingB" DefaultValue="False" />
</Settings>

Then let's see how they displayed:

Setting file location and contents

How it is displayed now

How I suggest to display it

C:\Program Files\Microsoft StyleCop 4.4.0.9\
("root config")
<Settings>
····<Setting Name="SettingA" Value="True">
</Settings>

[ x ] SettingA
[ ] SettingB

[ x ] SettingA
[ ] SettingB

D:\Projects\
("local config level 1")
<Settings>
····<Setting Name="SettingB" Value="True">
</Settings>

[ x ] SettingA
[ x ] SettingB

[ x ] SettingA
[ x ] SettingB

D:\Projects\MyProject\
("local config level 2")
<Settings>
</Settings>

[ x ] SettingA
[ x ] SettingB

[ x ] SettingA
[ x ] SettingB

If we look at the first row, we will see that root config settings are never displayed in bold (although they differ from default ones).
And I see a little inconsistency in it. (In fact, I suspect that it is a reason for various bug during root config editing - that is why I've decided to understand your intensions more deeply).

So, could you somehow comment this behaviour?

Thanks for paying attention!

Best regards,
Oleg Shuruev

Read the full discussion online.

To add a post to this discussion, reply to this email (stylecop@discussions.codeplex.com)

To start a new discussion for this project, email stylecop@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com