Fix warnings: variables, not initialized or not set #337

Open
wants to merge 24 commits into
from

Projects

None yet

3 participants

@CloCkWeRX
Contributor

This isn't all of them, but it makes things look a lot less like:

bundle exec rake test:unit
...
./home/clockwerx/xeroizer/lib/xeroizer/record/base_model.rb:100: warning: instance variable @allow_batch_operations not initialized
/home/clockwerx/xeroizer/lib/xeroizer/record/base_model.rb:100: warning: instance variable @allow_batch_operations not initialized
/home/clockwerx/xeroizer/lib/xeroizer/record/base_model.rb:100: warning: instance variable @allow_batch_operations not initialized
/home/clockwerx/xeroizer/lib/xeroizer/record/base_model.rb:100: warning: instance variable @allow_batch_operations not initialized
/home/clockwerx/xeroizer/lib/xeroizer/record/base_model.rb:100: warning: instance variable @allow_batch_operations not initialized
./home/clockwerx/xeroizer/lib/xeroizer/record/base_model.rb:100: warning: instance variable @allow_batch_operations not initialized
/home/clockwerx/xeroizer/lib/xeroizer/record/base_model.rb:100: warning: instance variable @allow_batch_operations not initialized
@tatey
tatey commented Dec 13, 2016

Appreciate you fixing these tests. I'm just in the process of making a patch and saw all the warnings 👍

CloCkWeRX added some commits Dec 13, 2016
@CloCkWeRX CloCkWeRX lib/xeroizer/report/factory.rb:39: warning: assigned but unused varia…
…ble - ex
e8e78ea
@CloCkWeRX CloCkWeRX test/unit/report_test.rb:66: warning: assigned but unused variable - …
…num_regex
c961fdd
@CloCkWeRX CloCkWeRX test/unit/report_test.rb:97: warning: shadowing outer local variable …
…- row
85d27fb
@CloCkWeRX CloCkWeRX Refactor to DRY a little 5d80672
@CloCkWeRX CloCkWeRX test/unit/report_test.rb:97: warning: shadowing outer local variable …
…- row
0de9362
@CloCkWeRX CloCkWeRX lib/xeroizer/models/invoice.rb:149: warning: shadowing outer local va…
…riable - sum
a1d8939
@CloCkWeRX CloCkWeRX lib/xeroizer/report/factory.rb:26: warning: shadowing outer local var…
…iable - response
34f16ec
@CloCkWeRX CloCkWeRX /home/clockwerx/xeroizer/lib/xeroizer/report/base.rb:1: warning: load…
…ing in progress, circular require considered harmful - /home/clockwerx/xeroizer/lib/xeroizer/report/base.rb
9735dfa
@CloCkWeRX CloCkWeRX lib/xeroizer/models/credit_note.rb:97: warning: shadowing outer local…
… variable - sum
b4a8eb2
@CloCkWeRX CloCkWeRX warning: shadowing outer local variable - b 4d298a2
@CloCkWeRX CloCkWeRX Avoid defining accessors for :calculated fields, on the assumption a …
…user promises to implement them
12afb5a
@CloCkWeRX CloCkWeRX For the short term, leave repeating_invoice fields as non calculated …
…(as nothing actually calculates for them yet)
d6381b5
@CloCkWeRX CloCkWeRX Refactoring: Skip creating accessors if we're going to override it im…
…mediately
6bbb115
@CloCkWeRX CloCkWeRX Fix unused variable warnings d15edf5
@CloCkWeRX CloCkWeRX lib/xeroizer/record/xml_helper.rb:37: warning: shadowing outer local …
…variable - element
d046a8d
@CloCkWeRX CloCkWeRX Fix indent by 1x layer c362fce
@CloCkWeRX CloCkWeRX Fix indent by 1x layer 8112a34
@CloCkWeRX
Contributor

Might need to have a think about the skip_writer or calculated changes; I added documentation but am not really sure if its enough.

It does prevent double method definition though.

@nnc
nnc commented Dec 13, 2016

Thank you for this pull request @CloCkWeRX. It's so great to see all this work being done on Xeroizer!

It may be easier and quicker for @waynerobinson to review and merge all these changes if you can split this into 3 pull request:

  1. warning fixes and similar
  2. model/association improvements
  3. whitespace changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment