Closed haacked closed 11 years ago
What's the benefit of making the attribute configurable? It's just an extra option that puts mental weight on someone wanting to use this package.
I think the point @Haacked is making that certain tools like resharper have a feature that allows code time suggestions for argument validation. Resharep calls this "Annotations" http://www.jetbrains.com/resharper/webhelp/Code_Analysis__Annotations_in_Source_Code.html
So if we make our attribute names configurable people can tweak them to get extra value.
Is that correct @Haacked ?
@Haacked the problem with this is that the current approach of this fody addin is to remove the reference at compile time. So we trim all the attributes from the metadata. This allows people to deploy their assembly with no extra baggage. This would effectively render the r# integration moot.
An alternative approach would be to merge the attribute into the target assembly
Another approach is to hack the target xml doc file and use external annotations http://www.jetbrains.com/resharper/webhelp/Code_Analysis__External_Annotations.html This would be more compatible with the "no file to deploy" approach
With this approach i think making attribute configurable is less important.
Thoughts?
Ah, I didn't realize the reference is removed. So in the final compiled code, there's no attributes. In that case, you can probably close this.
just to being clear the "reference being removed" is a design decision of each addin. Fody does not enforce this. this addin can decide not remove the reference. but the result is that the ref assembly needs to be shipped,
Ah, I see. So in the case of NullGuard.Fody
, you decided to remove the reference so the rewritten code that's shipped is pretty much exactly what you would have hand-written. Right? Thats' what I was hoping for. :)
Yeah people have like this approach in the past. Means fody addins can have no runtime dependencies.
But as mentioned r# also supports annotations in xml. the addin could hack the XML. this would still allow "no runtime dependencies" and get the code time intellisense.
Very cool! How far along is Fody.NullGuard? Ready for prime time?
well @distantcam found one issue https://github.com/SimonCropp/NullGuard.Fody/issues/5 we should also throw some async/await scenarios at it
I will throw it at some large codebases and then peverify them. will try with nservicebus and ravendb.
as "Ready for prime time?" i would not stick a "1.0" version on it until it gets a little more testing
I like that you moved the
AllowNullAttribute
into the ReferenceAssembly. Someone filed an issue against NullGuard to rename it toCanBeNullAttribute
so that R# understands it.I was planning to simply make it configurable. You can tell it which attribute is your "can be null" attribute and it'll look for that one.
Also, when this is done, I will probably submodule it into my NullGuard project. Great stuff!