If you write C#, I hope you have ReSharper.
If you have ReSharper, I hope you have tried its "Code Issues" feature. It has lots of good suggestions, and I need all the help I can get.
Staying clean requires running the analyzer over your whole solution. ReSharper doesn't update its results automatically: you have to explicitly click to make it happen. I hate explicitly clicking. It's also slow.
I decided to see if I could run it automatically in a Continuous Integration build server. I have figured out how to do so using TeamBuild on Visual Studio Online (VSO). Here's how:
I'd like to find a way to do this in Travis-CI, which would require running these tools on Mono. Let me know if you get it to work.
If you have ReSharper, I hope you have tried its "Code Issues" feature. It has lots of good suggestions, and I need all the help I can get.
Staying clean requires running the analyzer over your whole solution. ReSharper doesn't update its results automatically: you have to explicitly click to make it happen. I hate explicitly clicking. It's also slow.
I decided to see if I could run it automatically in a Continuous Integration build server. I have figured out how to do so using TeamBuild on Visual Studio Online (VSO). Here's how:
- Create a new Repo in VSO. Clone it locally.
- Add your solution
- Connect to your VSO repo in Visual Studio.
- Create the PreBuild.ps1 script you see below, to install ReSharper's command line tools
- Create the TeamBuild.proj script you see below, to run InspectCode and build your solution
- Team Explorer -> Builds -> New Build Definition. Select the Process tab
- Set Build Process Template to GitTemplate.12.xaml
- Projects = TeamBuild.proj
- Pre-build script path = Tools\PreBuild.ps1
- Run the script once on your machine to establish a baseline. Add it to Git.
- Push
Loading TeamBuild.proj from Gist 1d0e58acb2aeda163df3
Loading PreBuild.ps1 from Gist d5a71230d524965057be
I'd like to find a way to do this in Travis-CI, which would require running these tools on Mono. Let me know if you get it to work.
1 comment:
Agree very much with the sentiments regarding Resharper inspection value, so I created a build task you can use with Visual Studio Online:
https://marketplace.visualstudio.com/items?itemName=alanwales.resharper-code-analysis
Post a Comment