views:

38

answers:

2

Dinking around with stylecop settings files is getting annoying and messing with my repo structure. The repo is like this:

+ Trunk
    + src
        - ProjectA
        - ProjectB
        - ...
    + lib
        + Icons
        - ...
    + tools
        + NUnit
        + PartCover
        - Settings.StyleCop
        - ...

I would like all projects/solutions to use the settings file from trunk/tools and no others (preferable I'd like all settings file for only projects in this trunk to use that settings file, but system wide is acceptable.

I must be the only person who finds the way stylecop deals with settings files and merging settings files to be really annoying, or I just don't understand it properly.

+1  A: 

You can create a parent settings file, which applies to all projects in subfolders of the folder where the settings file is located:
Sharing StyleCop Settings Across Projects

BUT: that means you can't put the settings file into the trunk/tools folder.
You have to put it directly into the trunk folder instead.

But in my opinion, that's no problem. I did this in my own project as well:
The StyleCop assemblies and the target file are in a subfolder named \Libs\StyleCop, only the settings file itself is in the root folder. I can live with that.

haarrrgh
I had read that, but I'm a bit of a stickler for the organization of the repo and I really want to be able to have the settings file in the tools folder. I guess I might just have to dip into the code for it.
SnOrfus
A: 

If you really don't want to put the settings file in the Trunk folder, then you do have one other option: Replace the settings file in the StyleCop install directory.

Definitely 'an option of last resort', it makes the project validate differently on another computer that hasn't replaced the default StyleCop settings file.
I wouldn't recommend going down this path unless absolutely necessary.
The best way to make all projects use the same settings is by having the settings file in the topmost directory shared by all projects, that's all there is to it.

Task