StyleCop rule SA1642 insists that my documentation header for constructors must begin with 'Initializes a new instance of...'.
Whereas I agree with the rule itself, I just can't bring myself to accept StyleCop enforcing spellings I consider ugly. It's 'initialises' with an 's'!!!
Is it possible 开发者_如何转开发to modify the expected text, or must I simply disable a sensible rule?
In the latest stylecop settings you can set the "Culture for analysis" to en-GB in the options tab and it will use British spelling instead of American.
Current StyleCop version doesn't support customization for documentation rules. And there are no short-term plans to support it.
As a possible workaround (instead of disabling the entire rule) you could refer to some third-party custom rules. For example, StyleCop+ currently allows writing "Initializes a new instance." as well as "Initializes a new instance of the Class1 class."
So I guess it could be extended to also allow "Initialises ...". But if you want to force "Initialises" and prohibit "Initializes" it seems you need to wait for customizable documentation rules support.
精彩评论