[openstack-dev] Do not Repeat Yourself, Try fib!

Hengqing Hu hudayou at hotmail.com
Sat Jan 19 03:07:20 UTC 2013


Dear list,

We all know fibonacci numbers, by adding up 0 and 1 again and again, we 
finally get
a huge number exponential to size of serials of numbers added.

Also, we have both seem some kind of code duplication around in some of the
openstack projects. The projects might become better, if duplication 
could be easily
found and then the most concerned ones could be fixed. So I write a 
little tool to
simplify this kind of finding, an named it fib. If it's possible, I'd 
like to ask you to try
to use this tool as a compensation for pep or lint or pyflakes.

A change has already been in openstack-infra as a initial try to embed 
it into openstack:
https://review.openstack.org/#/c/20000/

The latest code could be found here:
https://github.com/hudayou/fib

In order to use this tool, you need to install guile package on a rpm 
based system and
at least guile-1.8 package on a deb based system.

As a demo output, you can find it here:
http://paste.openstack.org/show/29635/

The command used for config project in openstack-infra  is:
fedora-18 config]$ time ~/fib/fib -f . > config-dups

real    0m43.800s
user    0m40.535s
sys    0m2.768s


Looking forward to hear your feedback about this tool and hopefully we 
can move forward.

If you met any problems, you mind add a issue on github.
Pull requests are also quite appreciate.
If you find it useful and want to package it for some os distribution, 
feel free to do it.

Best Regards, Hengqing Hu



More information about the OpenStack-dev mailing list