pboling/celluloid-io-pg-listener

View on GitHub

Showing 351 of 351 total issues

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

  opts.banner = "Usage: bin/supervisor [options]"
Severity: Minor
Found in bin/supervision by rubocop

Checks if uses of quotes match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
"No special symbols"
"No string interpolation"
"Just text"

# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"

Example: EnforcedStyle: double_quotes

# bad
'Just some text'
'No special chars or interpolation'

# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

  opts.on("-c", "--config FILE", "Path to YAML configuration file") do |file|
Severity: Minor
Found in bin/supervision by rubocop

Checks if uses of quotes match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
"No special symbols"
"No string interpolation"
"Just text"

# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"

Example: EnforcedStyle: double_quotes

# bad
'Just some text'
'No special chars or interpolation'

# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"

Line is too long. [114/80]
Open

  # For a Client that will be used inside a SupervisorContainer you want to let the Supervisor handle termination.
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

Extra empty line detected at class body beginning.
Open


      # see http://deveiate.org/code/pg/PG/Connection.html for key meanings

This cops checks if empty lines around the bodies of classes match the configuration.

Example: EnforcedStyle: empty_lines

# good

class Foo

  def bar
    # ...
  end

end

Example: EnforcedStyle: emptylinesexcept_namespace

# good

class Foo
  class Bar

    # ...

  end
end

Example: EnforcedStyle: emptylinesspecial

# good
class Foo

  def bar; end

end

Example: EnforcedStyle: noemptylines (default)

# good

class Foo
  def bar
    # ...
  end
end

Use caller(1..1).first instead of caller.first.
Open

    puts "unlisten wrapper: #{wrapper},\nunlisten_wrapper_type: #{unlisten_wrapper_type},\ncaller: #{caller.first}"
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

This cop identifies places where caller[n] can be replaced by caller(n..n).first.

Example:

# bad
caller[1]
caller.first
caller_locations[1]
caller_locations.first

# good
caller(2..2).first
caller(1..1).first
caller_locations(2..2).first
caller_locations(1..1).first

Extra empty line detected at class body end.
Open


    end

This cops checks if empty lines around the bodies of classes match the configuration.

Example: EnforcedStyle: empty_lines

# good

class Foo

  def bar
    # ...
  end

end

Example: EnforcedStyle: emptylinesexcept_namespace

# good

class Foo
  class Bar

    # ...

  end
end

Example: EnforcedStyle: emptylinesspecial

# good
class Foo

  def bar; end

end

Example: EnforcedStyle: noemptylines (default)

# good

class Foo
  def bar
    # ...
  end
end

Line is too long. [96/80]
Open

        subclassed_client = hash_arg[:subclassed_client] = hash_arg[:subclassed_client] || false

Line is too long. [126/80]
Open

        # Unlike in the original class, the prepends have been usurped since this overridden method is now highest precedence.

Line is too long. [112/80]
Open

        @client_extracted_signature = CelluloidIOPGListener::Initialization::ClientExtractedSignature.new(*args)

Line is too long. [87/80]
Open

      @yaml_config = @yaml_config["listening_group"] if @yaml_config["listening_group"]

Missing top-level module documentation comment.
Open

    module ArgumentExtraction

This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.

The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.

Example:

# bad
class Person
  # ...
end

# good
# Description/Explanation of Person class
class Person
  # ...
end

Do not use :: for method calls.
Open

      @yaml_config = yaml_hash || YAML::load(ERB.new(File.read(path_to_yaml)).result)

This cop checks for methods invoked via the :: operator instead of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir).

Example:

# bad
Timeout::timeout(500) { do_something }
FileUtils::rmdir(dir)
Marshal::dump(obj)

# good
Timeout.timeout(500) { do_something }
FileUtils.rmdir(dir)
Marshal.dump(obj)

Prefer single-quoted strings inside interpolations.
Open

          info "Listener not active for channel '#{listener_config["args"]["channel"]}' on database '#{listener_config["args"]["dbname"]}'..."

This cop checks that quotes inside the string interpolation match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
result = "Tests #{success ? "PASS" : "FAIL"}"

# good
result = "Tests #{success ? 'PASS' : 'FAIL'}"

Example: EnforcedStyle: double_quotes

# bad
result = "Tests #{success ? 'PASS' : 'FAIL'}"

# good
result = "Tests #{success ? "PASS" : "FAIL"}"

Extra empty line detected at module body beginning.
Open


    class InvalidClient < StandardError; end

This cops checks if empty lines around the bodies of modules match the configuration.

Example: EnforcedStyle: empty_lines

# good

module Foo

  def bar
    # ...
  end

end

Example: EnforcedStyle: emptylinesexcept_namespace

# good

module Foo
  module Bar

    # ...

  end
end

Example: EnforcedStyle: emptylinesspecial

# good
module Foo

  def bar; end

end

Example: EnforcedStyle: noemptylines (default)

# good

module Foo
  def bar
    # ...
  end
end

Do not use do with multi-line while.
Open

        while notification = pg_connection.notifies do

Checks for uses of do in multi-line while/until statements.

Example:

# bad
while x.any? do
  do_something(x.pop)
end

# good
while x.any?
  do_something(x.pop)
end

Example:

# bad
until x.empty? do
  do_something(x.pop)
end

# good
until x.empty?
  do_something(x.pop)
end

Line is too long. [81/80]
Open

  #           redis_url: <%= ENV["REDISTOGO_URL"] || "redis://localhost:6379/" %>

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

        args.merge!(convert_database_url_to_hash(db_url: args.delete("database_url")))

Checks if uses of quotes match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
"No special symbols"
"No string interpolation"
"Just text"

# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"

Example: EnforcedStyle: double_quotes

# bad
'Just some text'
'No special chars or interpolation'

# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

      connection_info["dbname"]   = (uri.path || "").split("/")[1]

Checks if uses of quotes match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
"No special symbols"
"No string interpolation"
"Just text"

# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"

Example: EnforcedStyle: double_quotes

# bad
'Just some text'
'No special chars or interpolation'

# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"

Align merge with (hash_arg.keys & KEYS). on line 30.
Open

          merge(hash_arg[:conninfo_hash] || {})

This cop checks the indentation of the method name part in method calls that span more than one line.

Example: EnforcedStyle: aligned

# bad
while myvariable
.b
  # do something
end

# good
while myvariable
      .b
  # do something
end

# good
Thing.a
     .b
     .c

Example: EnforcedStyle: indented

# good
while myvariable
  .b

  # do something
end

Example: EnforcedStyle: indentedrelativeto_receiver

# good
while myvariable
        .a
        .b

  # do something
end

# good
myvariable = Thing
               .a
               .b
               .c

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

require "celluloid-io-pg-listener/examples/listener_client_by_inheritance"
Severity: Minor
Found in bin/supervision by rubocop

Checks if uses of quotes match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
"No special symbols"
"No string interpolation"
"Just text"

# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"

Example: EnforcedStyle: double_quotes

# bad
'Just some text'
'No special chars or interpolation'

# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"
Severity
Category
Status
Source
Language