<p>ReSharper Code cleanup feature (with "<a href="http://www.jetbrains.com/resharper/features/code_formatting.html#Reordering_Type_Members_C#_only" rel="noreferrer">reorder members</a>" and "<a href="http://www.jetbrains.com/resharper/features/code_formatting.html#Code_Style_Configuration_and_Sharing" rel="noreferrer">reformat code</a>" enabled) is really great. You define a layout template using XML, then a simple key combination reorganizes your whole source file (or folder/project/solution) according to the rules you set in the template.</p>

<p>Anyway, do you think that could be a problem regarding VCS like subversion, cvs, git, etc. ? Is there a chance that it causes many undesired conflicts ?</p>

<p>Thank you.</p>

[{'answer_id': 56316, 'author': 'Lasse V. Karlsen', 'author_id': 267, 'author_profile': 'https://Stackoverflow.com/users/267', 'pm_score': 2, 'selected': False, 'text': "<p>It can definitely cause conflicts, so I would make sure you don't reformat entire files if there are people working on them in parallel.</p>\n"}, {'answer_id': 56338, 'author': 'pkaeding', 'author_id': 4257, 'author_profile': 'https://Stackoverflow.com/users/4257', 'pm_score': 5, 'selected': True, 'text': '<p>Yes, it will definitely cause problems.  In addition to creating conflicts that have to be manually resolved, when you check in a file that has been reformatted, the VCS will note almost every line as having been changed.  This will make it hard for you or a teammate to look back at the history and see what changed when.</p>\n\n<p>That said, if everyone autoformats their code the same way (ie, you distribute that XML template to the team), then it might work well.  The problems really only come in when not everyone is doing the same thing.</p>\n'}, {'answer_id': 56339, 'author': 'Compile This', 'author_id': 4048, 'author_profile': 'https://Stackoverflow.com/users/4048', 'pm_score': 0, 'selected': False, 'text': '<p>It definitely could cause conflicts.</p>\n\n<p>If you want to use this in a multi-user environment then the configuration of Resharper needs to format your code to a set of standards which are enforced in your organization regardless of whether users make use of Resharper or not.</p>\n\n<p>That way you are using the tool to ensure your own code meets the standards, not blanket applying your preferences to the whole codebase.</p>\n'}, {'answer_id': 56364, 'author': 'Simon Steele', 'author_id': 4591, 'author_profile': 'https://Stackoverflow.com/users/4591', 'pm_score': 0, 'selected': False, 'text': "<p>I Agree with the previous answers that state that conflicts are possible and even likely. </p>\n\n<p>If you are planning to reformat code then at least make sure that you don't mix reformat checkins with those that change the function of the actual code. This way people can skip past check-ins that are simple reformattings. It's also a good idea to make sure that everyone knows a reformat is coming up so that they can object if they have ongoing work in that area.</p>\n"}, {'answer_id': 56385, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 3, 'selected': False, 'text': "<p>I'm waiting for an IDE or an editor that always saves source code using some baseline formatting rules, but allows each individual developer to display and edit the code in their own preferred format.  That way I can put my open curly brace at the beginning of the next line and not at the end of the current line where all you heathens seem to think it goes.</p>\n\n<p>My guess is I'll be waiting for a long time.</p>\n"}, {'answer_id': 57851, 'author': 'Daniel Fortunov', 'author_id': 5975, 'author_profile': 'https://Stackoverflow.com/users/5975', 'pm_score': 2, 'selected': False, 'text': '<p>You can use <a href="http://code.msdn.microsoft.com/sourceanalysis" rel="nofollow noreferrer">StyleCop</a> to enforce a comprehensive set of standards which pretty much forces everyone to use the same layout styles. Then all you need to do is develop a ReSharper code style specification that matches this, and distribute it to the team.</p>\n\n<p>I\'m still waiting for <a href="https://stackoverflow.com/questions/57859/is-there-a-standard-resharper-code-style-definition-that-matches-all-the-stylec">someone else to do this</a>, and for JetBrains to clear up all the niggling details which aren\'t fully supported, in order to allow ReSharper to basically guarantee full StyleCop compliance.</p>\n'}, {'answer_id': 187105, 'author': 'Rinat Abdullin', 'author_id': 47366, 'author_profile': 'https://Stackoverflow.com/users/47366', 'pm_score': 3, 'selected': False, 'text': '<ul>\n<li>Just reformat the whole solution\nonce</li>\n<li>AND make sure that every developer\nis using Resharper</li>\n<li>AND make sure that formatting\noptions are shared and versioned\n(code style sharing options)</li>\n</ul>\n'}, {'answer_id': 709901, 'author': 'pablo', 'author_id': 72456, 'author_profile': 'https://Stackoverflow.com/users/72456', 'pm_score': 0, 'selected': False, 'text': '<p>We\'re working on something to work with refactors at the source code level. We call it Xmerge, and it\'s now part of <a href="http://www.plasticscm.com" rel="nofollow noreferrer">Plastic</a>. It\'s just a first approach, since we\'re working on more advanced solutions. Check it <a href="http://codicesoftware.blogspot.com/2008/08/xmerge-tool-to-handle-refactors.html" rel="nofollow noreferrer">here</a>.</p>\n'}, {'answer_id': 2500382, 'author': 'rjmunro', 'author_id': 3408, 'author_profile': 'https://Stackoverflow.com/users/3408', 'pm_score': 0, 'selected': False, 'text': '<p>It might be a good idea to write a script to check out every version in your source control history, apply the code cleaning, then check it into a new repository. Then use that repository for all your work in future.</p>\n'}]
['https://Stackoverflow.com/questions/56313', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4687/']