[BioRuby] Code cleanup: expanded tabs into spaces.

Anurag Priyam anurag08priyam at gmail.com
Sat Apr 17 00:06:48 UTC 2010


>
> Please do not replace the tabs inside string literals and
> comment lines. These tabs have special meanings.
> Tabs in string literals apparently have their own meanings.
> Tabs in comments normally do not affect behavior of programs,
> but please keep them becase these may be excerption from other
> literature, description of data formats using tabs, or some
> other intention.
>
>
Ok. It had occurred to me to not replace tabs in string literals and
comments but the easier solution does not seem to take care of that. I will
try to come up with a better solution( unless, it turns to be hand editing
:P ).

Did you execute all tests before committing? It seems some
> tests would fail because of the changes in string literals.
> Some functions without tests or uncovered with tests might
> be silently broken. It seems parsing Ruby syntax or edit
> files by hand may be needed.
>

I had. Forgot to mention. I had 2 failures and 4 errors both before and
after my changes. Please do have a look at the test output. I have truncated
parts of traceback and added my comments in [#  ] to explain the failure.

  1) Error:
test_log(Bio::FuncTestSOAPWSDL):
Errno::ECONNREFUSED: Connection refused - connect(2)
    /usr/lib/ruby/1.8/net/http.rb:560:in `initialize'
    ...
    ./test/functional/bio/io/test_soapwsdl.rb:26:in `setup'

  2) Error:
test_set_log(Bio::FuncTestSOAPWSDL):
Errno::ECONNREFUSED: Connection refused - connect(2)
    /usr/lib/ruby/1.8/net/http.rb:560:in `initialize'
    ...
    ./test/functional/bio/io/test_soapwsdl.rb:26:in `setup'

  3) Error:
test_set_wsdl(Bio::FuncTestSOAPWSDL):
Errno::ECONNREFUSED: Connection refused - connect(2)
    /usr/lib/ruby/1.8/net/http.rb:560:in `initialize'
    ...
    ./test/functional/bio/io/test_soapwsdl.rb:26:in `setup'

  4) Error:
test_wsdl(Bio::FuncTestSOAPWSDL):
Errno::ECONNREFUSED: Connection refused - connect(2)
    /usr/lib/ruby/1.8/net/http.rb:560:in `initialize'
    ....
    ./test/functional/bio/io/test_soapwsdl.rb:26:in `setup'


[# Test 1-4: At college, we use proxy. This error could be because of proxy
settings not being read or initialized properly. I have had such errors
working with net/* libraries. I will investigate the exact reason thoroughly
and get back to you.]


  5) Failure:
test_libxml(Bio::TestPhyloXMLWriter_Check_LibXML)
[./test/unit/bio/db/test_phyloxml_writer.rb:31]:
Error: libxml-ruby library is not present. Please install libxml-ruby
library. It is needed for Bio::PhyloXML module. Unit test for PhyloXML will
not be performed.
<nil> is not true.

  6) Failure:
test_libxml(Bio::TestPhyloXML_Check_LibXML)
[./test/unit/bio/db/test_phyloxml.rb:29]:
Error: libxml-ruby library is not present. Please install libxml-ruby
library. It is needed for Bio::PhyloXML module. Unit test for PhyloXML will
not be performed.
<nil> is not true.


[#  tests 5and 6 are not initialized properly. I have libxml-ruby installed.
I had written a thin wrapper over libxml to parse NeXML and tests as a
demonstration for my GSoC 2010 proposal. And it works for me.]


2687 tests, 19751 assertions, 2 failures, 4 errors
rake aborted!
Command failed with status (1): [/usr/bin/ruby1.8 -I"lib"
"/usr/lib/ruby/ge...]

[# I think the errors have not been caused by my changes.


> Please avoid single big commit. This makes hard if we need
> to revert few files due to unexpected regressions.
> In this case, because changes in each file are independent
> each other, one file one commit would be good. (This is rare
> special case. Usually, a commit can contain changes across
> two or more files if they are strongly related, e.g. when
> we move a method from a file to another, the changes of two
> files should be included in a single commit.)
>
>
I understand that, it is a good practice. 90+ ruby files have mixed
indentation problem :(.

$pwd
~/src/bioruby

$grep -sl "\t" **/*.rb | wc -l
97

That would mean 97 commits. If I prove my reasons for the failure of above
tests are there chance that the changes will be merged?

-- 
Anurag Priyam
2nd Year,Mechanical Engineering,
IIT Kharagpur.
+91-9775550642



More information about the BioRuby mailing list