ninject / Ninject

the ninja of .net dependency injectors
http://ninject.org/
Other
2.68k stars 531 forks source link

ReSharper Code Annotations #157

Open robv8r opened 9 years ago

robv8r commented 9 years ago

It would be nice if Ninject used JetBrains ReSharper Code Annotations. This would help those of us who use ReSharper and Ninject to write better code.

ReSharper performs Code Analysis at design-time to point out possible issues, such as passing a null value to a method that does not allow null values. It's useful for both the developer of the Public API (such as Ninject) and the consumer of the API (such as applications that use Ninject.)

By adding ReSharper Code Annotations to Ninject, ReSharper can better understand the otherwise implicit contracts established by Ninject's source code and therefore provide more accurate feedback to developers.

A few things to note:

  1. Using ReSharper Code Annotations does not add any dependencies to the API or consuming applications.
  2. This is because ReSharper Code Annotations are conditional and are therefore not compiled into binaries.
robv8r commented 9 years ago

I have fully annotated 3.2.2 in a fork of this project. I have included the annotations in the Community External Annotations project.

If you have R#9, you can get this extension through the official ReShaper Extension feed.

I'm happy to continue annotating the Ninject API as new versions come out and include the annotations in the Community External Annotations package. Over time, this will probably become cumbersome. Instead, I'd like to fully annotate the current development branch so that the Annotations live with the official source code.

Before I do the work, I'd like to know if the owners of this project want the annotations in the official API.

Feel free to review my work on the fork I mentioned above.