jwhitcraft/dockercompose-generator

View on GitHub

Showing 25 of 25 total issues

Redundant self detected.
Open

      @services[name] if self.service?(name)
Severity: Minor
Found in lib/docker-compose/generator.rb by rubocop

This cop checks for redundant uses of self.

The usage of self is only needed when:

  • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

  • Calling an attribute writer to prevent an local variable assignment.

Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

Note we allow uses of self with operators because it would be awkward otherwise.

Example:

# bad
def foo(bar)
  self.baz
end

# good
def foo(bar)
  self.bar  # Resolves name clash with the argument.
end

def foo
  bar = 1
  self.bar  # Resolves name clash with the local variable.
end

def foo
  %w[x y z].select do |bar|
    self.bar == bar  # Resolves name clash with argument of the block.
  end
end

Prefer to_s over string interpolation.
Open

          drop_from_array("#{method}", item)

This cop checks for strings that are just an interpolated expression.

Example:

# bad
"#{@var}"

# good
@var.to_s

# good if @var is already a String
@var

Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem codeclimate-test-reporter should appear before simplecov.
Open

  gem 'codeclimate-test-reporter', require: false
Severity: Minor
Found in Gemfile by rubocop

Gems should be alphabetically sorted within groups.

Example:

# bad
gem 'rubocop'
gem 'rspec'

# good
gem 'rspec'
gem 'rubocop'

# good
gem 'rubocop'

gem 'rspec'

# good only if TreatCommentsAsGroupSeparators is true
# For code quality
gem 'rubocop'
# For tests
gem 'rspec'

Prefer to_s over string interpolation.
Open

          add_to_array('ports', "#{host}")

This cop checks for strings that are just an interpolated expression.

Example:

# bad
"#{@var}"

# good
@var.to_s

# good if @var is already a String
@var

Unnecessary utf-8 encoding comment.
Open

# coding: utf-8
Severity: Minor
Found in docker-compose-generator.gemspec by rubocop
Severity
Category
Status
Source
Language