added StyleCop.MSBuild to all projects #587

Merged
merged 1 commit into from Mar 27, 2014

Projects

None yet

5 participants

@adamralph
Contributor

I can see from the history that StyleCop analysis was added to the build script at one point but then reverted. This PR shows how it can be done with StyleCop.MSBuild and configured to make it an unobtrusive way to get StyleCop running with every single build whilst placing no additional burden on contributors or coordinators.

Things to note:

  • all rules which are currently violated are switched off in Settings.StyleCop so no warnings are currently being generated in the build output
  • all rules which are currently complied with are switched on in Settings.StyleCop
  • any future violations will only be reported as warnings rather than errors so will not affect build success
  • StyleCop analysis is very fast and does not noticeably affect build time (unlike FxCop)
  • edit-stylecop-settings.cmd is added as a convenient shortcut for editing Settings.StyleCop in StyleCopSettingsEditor.exe (also contained in the NuGet package)
  • later, if/when it is desirable and/or convenient, rules can be switched on one by one using StyleCopSettingsEditor.exe and addressed appropriately

Things to note about the StyleCop.MSBuild package as opposed to other methods of StyleCop invocation:

  • runs on every build, whether in VS, from command line, on local machine, on build server, etc.
  • fully compatible with NuGet package restore since NuGet 2.7
  • self contained package which does not rely on a StyleCop installation on any machine
@khellang
Member
khellang commented Mar 1, 2014

You're on 🔥! 👍 from me, but I'll leave this hanging for the others to chime in 😄

@filipw
Member
filipw commented Mar 3, 2014

looks cool

@khellang
Member
khellang commented Mar 3, 2014

I think @glennblock needs to chime in here. He weren't too happy the last time StyleCop came around 😉

@jrusbatch
Member

👍

On Monday, March 3, 2014, Kristian Hellang notifications@github.com wrote:

I think @glennblock https://github.com/glennblock needs to chime in
here. He weren't too happy the last time StyleCop came around [image:
😉]


Reply to this email directly or view it on GitHubhttps://github.com/scriptcs/scriptcs/pull/587#issuecomment-36541961
.

@jrusbatch
Member

Assigning to @glennblock to avoid any future 3:00a text messages about StyleCop. 😉

@glennblock glennblock was assigned by jrusbatch Mar 4, 2014
@adamralph
Contributor

rebased off latest dev

@adamralph
Contributor

rebased off latest dev

@glennblock glennblock merged commit 93b3ffc into scriptcs:dev Mar 27, 2014

1 check passed

default TeamCity Build ScriptCS :: CI Build (dev) finished: Tests passed: 228
Details
@glennblock
Member

@adamralph thanks!

@adamralph adamralph deleted the unknown repository branch Mar 27, 2014
@adamralph adamralph added the build label Jun 18, 2014
@adamralph adamralph added this to the v0.10 milestone Jun 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment