mvidner/ruby-dbus

View on GitHub
.rubocop.yml

Summary

Maintainability
Test Coverage
AllCops:
  TargetRubyVersion: 2.4
  Exclude:
    # Do not check code borrowed from ActiveSupport
    - 'lib/dbus/core_ext/**/*.rb'
    # Bundled dependencies
    - 'vendor/**/*'
    # RPM spec is not RSpec
    - package/rubygem-ruby-dbus.spec

# https://github.com/SUSE/style-guides/blob/master/Ruby.md#strings
Style/StringLiterals:
  EnforcedStyle: double_quotes

Style/StringLiteralsInInterpolation:
  EnforcedStyle: double_quotes

# https://github.com/SUSE/style-guides/blob/master/Ruby.md#arrays
Style/WordArray:
  Enabled: false

Style/SymbolArray:
  Enabled: false

Layout/IndentationConsistency:
  Exclude:
    # a conflict between markdown and ruby indentation
    - examples/doc/variants.rb

# I am not ready to fix these
Style/IfUnlessModifier:
  Enabled: false

# I am not ready to fix these
Style/WhileUntilModifier:
  Enabled: false

# I am not ready to fix these
Style/NegatedIf:
  Enabled: false

Style/EmptyElse:
  EnforcedStyle: "nil"

# Need to check whether API stays OK
Lint/InheritException:
  Exclude:
    - 'lib/dbus.rb'
    - 'lib/dbus/auth.rb'
    - 'lib/dbus/connection.rb'
    - 'lib/dbus/introspect.rb'
    - 'lib/dbus/marshall.rb'
    - 'lib/dbus/matchrule.rb'
    - 'lib/dbus/message.rb'
    - 'lib/dbus/type.rb'

# Offense count: 7
Lint/SuppressedException:
  Exclude:
    - 'lib/dbus/marshall.rb'
    - 'lib/dbus/message_queue.rb'
    - 'lib/dbus/xml.rb'
    - 'spec/server_spec.rb'
    - 'spec/service_newapi.rb'

# Offense count: 5
Lint/RescueException:
  Exclude:
    - 'examples/no-introspect/nm-test.rb'
    - 'lib/dbus/connection.rb'
    - 'lib/dbus/message_queue.rb'

Naming/PredicateName:
  NamePrefix:
    # has_ and have_ are allowed
    - is_

# Offense count: 1
Lint/NestedMethodDefinition:
  Exclude:
    - 'spec/main_loop_spec.rb'

# Offense count: 34
Metrics/AbcSize:
  Max: 123

# Offense count: 2
Metrics/BlockNesting:
  Max: 4

Metrics/BlockLength:
  Max: 70
  Exclude:
    - 'spec/*_spec.rb'

# Offense count: 8
# Configuration parameters: CountComments.
Metrics/ClassLength:
  Max: 330

# Offense count: 12
Metrics/CyclomaticComplexity:
  Max: 29

# Offense count: 62
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
# URISchemes: http, https
Layout/LineLength:
  Max: 118

# Offense count: 49
# Configuration parameters: CountComments.
Metrics/MethodLength:
  Max: 102

# Offense count: 9
Metrics/PerceivedComplexity:
  Max: 27

# Offense count: 8
Style/ClassVars:
  Exclude:
    - 'lib/dbus/object.rb'
    - 'lib/dbus/message.rb'

# Offense count: 16
Style/Documentation:
  Exclude:
    - 'spec/**/*'
    - 'test/**/*'
    - 'examples/service/service_newapi.rb'
    - 'lib/dbus/api_options.rb'
    - 'lib/dbus/error.rb'
    - 'lib/dbus/logger.rb'
    - 'lib/dbus/message.rb'
    - 'lib/dbus/message_queue.rb'
    - 'lib/dbus/type.rb'
    - 'lib/dbus/xml.rb'

# Buggy in 1.0, fixed in 1.12
# https://github.com/rubocop/rubocop/issues/5953
Style/AccessModifierDeclarations:
  Enabled: false

# Offense count: 1
Style/OptionalArguments:
  Exclude:
    - 'lib/dbus/proxy_object_interface.rb'

Style/AsciiComments:
  Exclude:
    # Spell author name correctly
    - 'lib/dbus/object_manager.rb'