You are previewing Instant StyleCop Code Analysis How-to.
O'Reilly logo
Instant StyleCop Code Analysis How-to

Book Description

Learn how to analyze and maintain code for your projects using Stylecop

  • Learn something new in an Instant! A short, fast, focused guide delivering immediate results

  • Create your own custom rule for the Stylecop engine

  • Check and maintain a C# coding style over your projects

  • Personalize Microsoft rules to fit your needs

  • Embed Stylecop analysis in your own tools

In Detail

In medium-sized and big projects, coding conventions are defined in order to improve readability and maintainability for all the developers of the team. Stylecop analyzes your code and detects coding rule violations during all the phases of your project lifecycle.

Stylecop Code Analysis How-to allows you to take advantage of the features of Stylecop by guiding you through how to configure it, how to integrate it in your project environment, and finally how to personalize it in order to fit your needs.

Stylecop Code Analysis How-to teaches you how to configure and integrate Stylecop in your programming environment. The book will do this by showing you how to configure Stylecop on the developers IDE to the continuous integration server.

You will also learn how to customize Stylecop to fit your coding style by creating new rules as well as learning how to personalize your headers file. You will also see how to embed it in your own tools, using as an example the creation of a real time analysis add-on for Monodevelop.

With Stylecop Code Analysis How-to, you will have an overview of all the required steps to successfully integrate your programming team and enforce your own coding rules.

Table of Contents

  1. Instant StyleCop Code Analysis How-to
    1. Instant StyleCop Code Analysis How-to
    2. Credits
    3. About the Author
    4. About the Reviewer
    5. www.PacktPub.com
      1. Support files, eBooks, discount offers and more
        1. Why Subscribe?
        2. Free Access for Packt account holders
    6. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    7. 1. Instant StyleCop Code Analysis How-to
      1. Installing StyleCop with Visual Studio (Simple)
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Rules activation
          2. Merging StyleCop settings
          3. Using StyleCop with Express editions of Visual Studio and SharpDevelop
      2. Understanding the Resharper add-in (Simple)
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Dev Express – Code Rush
          2. Code Maid
          3. NArrange
      3. Automating StyleCop using MSBuild (Simple)
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Setting up properties of the task in a more global way
          2. Excluding files from StyleCop analysis
      4. Automating StyleCop using a command-line batch (Simple)
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. StyleCopCmd for Mono and Linux systems
          2. StyleCop CLI
          3. Building your own
      5. Automating StyleCop using NAnt (Intermediate)
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      6. Integrating StyleCop analysis results in Jenkins/Hudson (Intermediate)
        1. Getting ready
        2. How to do it...
        3. How it works...
      7. Customizing file headers (Simple)
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Other ways to handle the headers
          2. Company configuration
      8. Creating custom rules (Intermediate)
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Customize your StyleCop settings dialog
          2. Unit testing your rules
      9. Integrating StyleCop in your own tool (Advanced)
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Add a configuration screen
          2. Do the work in a background thread
          3. Change the display of violations