How to export the code cleanup profiles?

Hi folks,

I've recently started using custom code cleanup profiles, a great feature that has been very useful in combination with automatic applying on git commit. I'd now like to do that on all my PCs and I'd like to copy my custom profiles, but I can't figure out how. I guess it's through the editor settings export, but I don't want to export all the settings and can't figure out which one contains the code cleanup profiles. Please help me :) How do I transfer them to other PCs / Rider installations?

0
1 comment

It is being stored in one of the layers of the layered settings (DotSettings). You can export it via from the Manage Layers, but you need to figure out what the layer the needed profiles are being stored in. 

I suggest you the following steps:

  • Open the sample project where you have the necessary cleanup profiles;
  • Verify if you have a SolutionName.sln.dotsettings (solution team-shared layer) or SolutionName.sln.dotsettings.user (solution personal layer) files in solution root directory;
    • If there are such files, verify its content. If the needed cleanup profile is there (look for `<s:String x:Key="/Default/CodeStyle/CodeCleanup/Profiles/=YourExactCleanupProfileName`);
    • If you found the needed cleanup profile there, export layer corresponding to the file where you found that.
  • If per-solution dotsettings file is missing the necessary cleanup profiles, the remaining layer is the global layer. Export it.
  • Finally, import the exported settings on another project/machine;

Hope that helps.

0

Please sign in to leave a comment.