Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 0.50.0 of rubocop alerts for offenses #158

Closed
aeden opened this issue Sep 29, 2017 · 1 comment
Closed

Version 0.50.0 of rubocop alerts for offenses #158

aeden opened this issue Sep 29, 2017 · 1 comment
Assignees
Labels

Comments

@aeden
Copy link
Member

aeden commented Sep 29, 2017

.rubocop_dnsimple.yml: Style/PredicateName has the wrong namespace - should be Naming
Inspecting 98 files
.W..........................C....................W.W.....W........................................

Offenses:

Rakefile:27:19: W: Avoid rescuing without specifying an error class.
    rm_r "yardoc" rescue nil
                  ^^^^^^
lib/dnsimple/client.rb:64:25: C: Use each_key instead of keys.each.
      Dnsimple::Default.keys.each do |key|
                        ^^^^^^^^^
lib/dnsimple/struct/extended_attribute.rb:34:7: W: Method Dnsimple::Struct::ExtendedAttribute#options= is defined at both lib/dnsimple/struct/extended_attribute.rb:27 and lib/dnsimple/struct/extended_attribute.rb:34.
      def options=(opts)
      ^^^
lib/dnsimple/struct/service.rb:55:7: W: Method Dnsimple::Struct::Service#settings= is defined at both lib/dnsimple/struct/service.rb:48 and lib/dnsimple/struct/service.rb:55.
      def settings=(settings)
      ^^^
lib/dnsimple/struct/whoami.rb:16:7: W: Method Dnsimple::Struct::Whoami#account= is defined at both lib/dnsimple/struct/whoami.rb:6 and lib/dnsimple/struct/whoami.rb:16.
      def account=(account)
      ^^^
lib/dnsimple/struct/whoami.rb:24:7: W: Method Dnsimple::Struct::Whoami#user= is defined at both lib/dnsimple/struct/whoami.rb:9 and lib/dnsimple/struct/whoami.rb:24.
      def user=(user)
      ^^^
@AnkurGel
Copy link

AnkurGel commented Oct 1, 2017

I think method already defined warnings can be fixed by changing the attribute from attr_accessor to attr_reader since there is customized writer declared for them.
For each_key, rubocop warning should probably figure out that Dnsimple::Default is a module, just because Dnsimple::Default respond to [keys]https://github.com/dnsimple/dnsimple-ruby/blob/master/lib/dnsimple/default.rb#L16) method, it doesn't has to be a hash 😄

@weppos weppos self-assigned this Oct 3, 2017
@weppos weppos added the bug label Oct 3, 2017
@weppos weppos closed this as completed in 3432077 Oct 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants