Circular namespace references

5 views
Skip to first unread message

mcintyre321

unread,
Apr 27, 2009, 9:10:56 AM4/27/09
to Gendarme
Hi there!

I've just stumbled across Gendarme and am very impressed. I'd like to
use it but there's one rule that I'd really like to see, which is to
check for circular namespace references (ie. Proj.NamespaceA.Class
references something in Proj.NamespaceB and Proj.NamespaceB.Class
references something in Proj.NamespaceB). I had a look through the
rules and couldn't find one for checking this. Is this something that
would be possible with Gendarme? If so, I'll have a look at the source
and try to come up with something!

Cedric Vivier

unread,
Apr 27, 2009, 9:32:11 AM4/27/09
to gend...@googlegroups.com
Hi!


On Mon, Apr 27, 2009 at 9:10 PM, mcintyre321 <mcint...@gmail.com> wrote:
check for circular namespace references (ie. Proj.NamespaceA.Class
references something in Proj.NamespaceB and Proj.NamespaceB.Class
references something in Proj.NamespaceB). I had a look through the
rules and couldn't find one for checking this. Is this something that
would be possible with Gendarme?

Yes, actually there is an "out-of-tree" dependency checking rule that can check this (among more complex dependency patterns) :
http://neonux.com/blog/2009/02/A-new-internal-dependency-checking-rule-for-Gendarme.html

Regards,

mcintyre321

unread,
Jun 18, 2009, 12:27:36 PM6/18/09
to Gendarme
I tried writing a c# version based off that link you posted but I
couldn't get it to work. Is the out of tree checking rule likely to be
in a future release of Gendarme or was it just something internal?

thanks


On Apr 27, 2:32 pm, Cedric Vivier <cedr...@neonux.com> wrote:
> Hi!
>
> On Mon, Apr 27, 2009 at 9:10 PM, mcintyre321 <mcintyre...@gmail.com> wrote:
> > check for circular namespace references (ie. Proj.NamespaceA.Class
> > references something in Proj.NamespaceB and Proj.NamespaceB.Class
> > references something in Proj.NamespaceB). I had a look through the
> > rules and couldn't find one for checking this. Is this something that
> > would be possible with Gendarme?
>
> Yes, actually there is an "out-of-tree" dependency checking rule that can
> check this (among more complex dependency patterns) :http://neonux.com/blog/2009/02/A-new-internal-dependency-checking-rul...
>
> Regards,

Cedric Vivier

unread,
Jun 18, 2009, 1:14:35 PM6/18/09
to gend...@googlegroups.com
On Fri, Jun 19, 2009 at 12:27 AM, mcintyre321 <mcint...@gmail.com> wrote:
I tried writing a c# version based off that link you posted but I
couldn't get it to work.

Do you mean that you try to use that rule for your project by subclassing DependencyCheckingRule in C# instead of using the DSL ?
Or that you just try to reimplement it in C# ?

 
Is the out of tree checking rule likely to be
in a future release of Gendarme or was it just something internal?

Afaik, not planned, at least not in the short/mid-term.
But not being integrated in a gendarme release does not mean that you cannot use it, there is plenty of uses for project specific-rules with Gendarme (the latter being a framework moreover just an application ;-) ).

Regards,

mcintyre321

unread,
Aug 14, 2009, 4:59:01 AM8/14/09
to Gendarme
TBH I attempted to rewrite it in c#, couldn't quite get cecil to do
what i expected and gave up. I'm being lazy and appealing to a higher
power by writing this. In an effort to not be lazy, I'll have another
stab at it!

On Jun 18, 6:14 pm, Cedric Vivier <cedr...@neonux.com> wrote:
Reply all
Reply to author
Forward
0 new messages