Disable StyleCop for specific lines

后端 未结 5 633
無奈伤痛
無奈伤痛 2021-02-05 01:12

We\'re using StyleCop in our C# projects. In some cases we\'d like to avoid the rules though. I know you can add // in the beginning of the

5条回答
  •  孤独总比滥情好
    2021-02-05 01:51

    This guy seems to have a good general ignore hack; he suggests putting this at the top of the file - tested and working with R#

    //------------------------------------------------------------------------------
    // 
    // This code was generated by a tool.
    // 
    //------------------------------------------------------------------------------
    

    Handy for when you are just churning out a load of boilerplate to adhere to a mainly unimplemented interface, for example.

提交回复
热议问题