.rubocop.yml
---
inherit_from: .rubocop_todo.yml
AllCops:
TargetRubyVersion: 2.5
Exclude:
- acceptance/**/*
- vendor/**/*
require:
- rubocop-performance
- rubocop-rspec
Layout/LineLength:
Enabled: false
Metrics/AbcSize:
Enabled: false
Metrics/BlockLength:
Enabled: false
Metrics/ClassLength:
Enabled: false
Metrics/CyclomaticComplexity:
Enabled: false
Metrics/MethodLength:
Enabled: false
Metrics/ModuleLength:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
Naming/ClassAndModuleCamelCase:
Exclude:
- 'spec/mocks/win32.rb'
Naming/MethodName:
Exclude:
- 'spec/mocks/win32ole.rb'
- 'spec/mocks/ffi.rb'
Naming/PredicateName:
Exclude:
- 'spec/**/*'
Naming/VariableNumber:
Exclude:
- 'lib/facter/resolvers/windows/ffi/networking_ffi.rb'
- 'lib/facter/util/facts/windows_release_finder.rb'
RSpec/DescribedClass:
EnforcedStyle: explicit
RSpec/ExampleLength:
Enabled: false
# It is sometimes better to expect().to receive().and_return
# or to receive different messages.
RSpec/MessageSpies:
Enabled: false
RSpec/MultipleExpectations:
Max: 3
RSpec/MultipleMemoizedHelpers:
Enabled: false
RSpec/NestedGroups:
Enabled: 6
RSpec/StubbedMock:
Enabled: false
RSpec/SubjectStub:
Exclude:
- 'spec/custom_facts/core/aggregate_spec.rb'
- 'spec/custom_facts/core/resolvable_spec.rb'
- 'spec/custom_facts/util/fact_spec.rb'
- 'spec/custom_facts/util/resolution_spec.rb'
# Prefer instance_double/instance_spy over double/spy because only methods
# defined on the underlying object can be stubbed. FFI and some Windows
# code can't be verified because of the way we fake out those classes.
RSpec/VerifiedDoubles:
Enabled: true
Exclude:
- 'spec/custom_facts/**/*'
- 'spec/facter/resolvers/aix/hardware_spec.rb'
- 'spec/facter/resolvers/*/ffi_helper_spec.rb'
- 'spec/facter/resolvers/windows/*'
- 'spec/facter/util/windows/network_utils_spec.rb'
- 'spec/facter/util/windows/win32ole_spec.rb'
# $stdout is preferred because it refers to the *current* stdout stream, while
# STDOUT refers to the original stream. However, we can't just switch to using
# $stdout, because it may have been assigned to a different object than STDOUT,
# such as a IO to a file.
Style/GlobalStdStream:
Exclude:
- 'lib/facter.rb'
- 'lib/facter/framework/cli/cli_launcher.rb'
- 'lib/facter/framework/logging/logger.rb'
- 'spec/framework/core/fact/internal/internal_fact_manager_spec.rb'
- 'spec/framework/logging/logger_spec.rb'
Style/IfUnlessModifier:
Enabled: false