Comments (3)
@FakeItEasy/owners so far I've managed to address all the warnings in the distributable (net40, net35, sl) projects apart from one rule:-
SA1623 : CSharp.Documentation : The property's documentation summary text must begin with: Gets
The problem is that this language doesn't really fit for fluent API properties. E.g.
/// <summary>
/// The call must have happened exactly the number of times
//// that is specified in the next step.
/// </summary>
public static IRepeatSpecification Exactly
{
get { return new RepeatSpecification((actual, expected) =>
actual == expected, "exactly"); }
}
I don't think it would make sense to document this with something like "Gets a repeat specification that blah blah... ".
So, we have two options:-
- Switch off the rule globally.
- Add specific suppressions.
The advantage of the former is that it's quicker and it avoids littering the code with suppression attributes but the disadvantage is that there are many places in the code where this rule should be observed and those sites will no longer be checked.
The advantage of the latter is that the rule still stays in place for those code sites which require it but the disadvantage is that we have to add a suppression attribute to each fluent API property (there are currently 72 of them), e.g.
[SuppressMessage("StyleCop.CSharp.DocumentationRules",
"SA1623:PropertySummaryDocumentationMustMatchAccessors", Justification = "Fluent API.")]
IMHO the latter is the more 'correct', if more verbose, solution and I don't mind taking the time to add the suppressions (it shouldn't take too long) so from that point of view I should probably just go ahead. However, It would also mean that we would have to add a suppression to any new fluent API properties when implementing new features so I guess we all need to be comfortable with that.
Thoughts?
from fakeiteasy.
@adamralph
According to http://stylecop.codeplex.com/wikipage?title=Rule%20Suppressions&referringTitle=Documentation (Suppress Message Usage) it should be possible to add the SuppressMessage attribute on the Repeated
class. So we only need to add it for new classes, but not new members on existing classes.
I agree that we shouldn't suppress it globally
from fakeiteasy.
@philippdolder great! I guess in most cases the properties for a given type are either all fluent API properties or not at all so that should fit. If there is a case where it doesn't fit then I can still suppress at the member level.
In that case, I'll go ahead with suppressions. Thanks for the input.
from fakeiteasy.
Related Issues (20)
- Publish target framework Support Policy HOT 5
- Allow to pass a delegate to Wrapping() HOT 9
- Same GetType result for different fakes HOT 2
- Failure to create fake via constructor with 'in' parameter HOT 5
- Provide a mechanism for capturing arguments passed to Fakes HOT 24
- How to match System.Security.Cryptography.Oid instances more easily? HOT 6
- Add registry of argument comparers HOT 1
- Match enumerable arguments by comparing contents rather than via `Equals` HOT 8
- Add assertion similar to Moq's `VerifyNoOtherCalls` HOT 8
- Feature request: ReturnsNextFromSequenceLazily() HOT 6
- Feature request: Then().Returns...() HOT 5
- Issue using Result Pattern and trying to fake a response
- Release 8.0.1 HOT 1
- Interface type property not return created object HOT 3
- How to fake a type that have `dynamic` (ExpandoObject) properties? HOT 3
- DoesNothing() and implicit creation options throws ArgumentException HOT 5
- Release 8.1.0 HOT 1
- Include README in NuGet package HOT 1
- Silence security vulnerability complaints over Microsoft.NETCore.App 2.1.0 HOT 2
- Release 8.2.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fakeiteasy.