Skip to content

Commit a6dd9e6

Browse files
committed
adjust rubocop configuration
1 parent ec47563 commit a6dd9e6

File tree

4 files changed

+71
-20
lines changed

4 files changed

+71
-20
lines changed

.rubocop.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ AllCops:
1010

1111
require:
1212
- rubocop-performance
13+
- rubocop-rake
1314
- rubocop-rspec
1415

15-
plugins:
16-
- rubocop-capybara
17-
1816
Layout/LineLength:
1917
Enabled: false
2018

.rubocop_todo.yml

Lines changed: 54 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,80 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config --no-auto-gen-timestamp`
3-
# using RuboCop version 1.78.0.
3+
# using RuboCop version 1.84.2.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 2
10-
# Configuration parameters: EnforcedStyle, AllowedPatterns, ForbiddenIdentifiers, ForbiddenPatterns.
11-
# SupportedStyles: snake_case, camelCase
12-
# ForbiddenIdentifiers: __id__, __send__
13-
Naming/MethodName:
14-
Exclude:
15-
- 'spec/mocks/win32ole.rb'
16-
- 'spec/mocks/ffi.rb'
17-
- 'spec/facter/util/windows/network_utils_spec.rb'
18-
199
# Offense count: 3
2010
# This cop supports safe autocorrection (--autocorrect).
2111
Performance/RegexpMatch:
2212
Exclude:
2313
- 'install.rb'
2414

15+
# Offense count: 1
16+
RSpec/IdenticalEqualityAssertion:
17+
Exclude:
18+
- 'spec/facter/util/resolvers/ssh_helper_spec.rb'
19+
20+
# Offense count: 50
21+
# Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns.
22+
RSpec/IndexedLet:
23+
Enabled: false
24+
25+
# Offense count: 1
26+
# This cop supports safe autocorrection (--autocorrect).
27+
RSpec/MatchArray:
28+
Exclude:
29+
- 'spec/facter/facts/solaris/ldom_spec.rb'
30+
31+
# Offense count: 18
32+
# Configuration parameters: AllowedPatterns.
33+
# AllowedPatterns: ^expect_, ^assert_
34+
RSpec/NoExpectationExample:
35+
Exclude:
36+
- 'spec/custom_facts/core/execution/fact_manager_spec.rb'
37+
- 'spec/custom_facts/core/resolvable_spec.rb'
38+
- 'spec/custom_facts/core/suitable_spec.rb'
39+
- 'spec/custom_facts/util/collection_spec.rb'
40+
- 'spec/custom_facts/util/parser_spec.rb'
41+
- 'spec/facter/resolvers/ec2_spec.rb'
42+
43+
# Offense count: 128
44+
# This cop supports unsafe autocorrection (--autocorrect-all).
45+
RSpec/ReceiveMessages:
46+
Enabled: false
47+
2548
# Offense count: 70
26-
# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
27-
# Include: **/*_spec*rb*, **/spec/**/*
28-
RSpec/FilePath:
49+
# Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector.
50+
# SupportedInflectors: default, active_support
51+
RSpec/SpecFilePathFormat:
2952
Enabled: false
3053

54+
# Offense count: 18
55+
# This cop supports unsafe autocorrection (--autocorrect-all).
56+
RSpec/VerifiedDoubleReference:
57+
Exclude:
58+
- 'spec/facter/resolvers/aix/serialnumber_spec.rb'
59+
- 'spec/facter/resolvers/bsd/ffi_helper_spec.rb'
60+
- 'spec/facter/resolvers/solaris/mountpoints_spec.rb'
61+
- 'spec/facter/resolvers/windows/fips_spec.rb'
62+
- 'spec/facter/resolvers/windows/netkvm_spec.rb'
63+
- 'spec/facter/resolvers/windows/networking_spec.rb'
64+
- 'spec/facter/resolvers/windows/product_release_spec.rb'
65+
- 'spec/facter/resolvers/windows/virtualization_spec.rb'
66+
- 'spec/facter/util/windows/network_utils_spec.rb'
67+
- 'spec/framework/core/options/option_store_spec.rb'
68+
- 'spec/framework/core/options_spec.rb'
69+
3170
# Offense count: 14
3271
Style/ClassVars:
3372
Exclude:
3473
- 'lib/facter/framework/logging/logger.rb'
3574
- 'spec/custom_facts/puppetlabs_spec/files.rb'
3675
- 'spec/framework/logging/logger_spec.rb'
3776

38-
# Offense count: 981
77+
# Offense count: 985
3978
# Configuration parameters: AllowedConstants.
4079
Style/Documentation:
4180
Enabled: false

openfact.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Gem::Specification.new do |spec|
4040
spec.add_development_dependency 'rspec', '~> 3.0'
4141
spec.add_development_dependency 'rubocop', '~> 1.28', '< 1.85'
4242
spec.add_development_dependency 'rubocop-performance', '~> 1.5'
43+
spec.add_development_dependency 'rubocop-rake', '< 1'
4344
spec.add_development_dependency 'rubocop-rspec', '>= 2.10', '< 4'
4445
spec.add_development_dependency 'simplecov', '~> 0.17'
4546
spec.add_development_dependency 'sys-filesystem', '~> 1.4'

spec/facter/facts/solaris/ldom_spec.rb

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,21 @@
4242
end
4343

4444
it 'returns virtual fact as ldom' do
45-
expect(fact.call_the_resolver).to contain_exactly(an_object_having_attributes(name: 'ldom', value: value, type: :core), an_object_having_attributes(name: 'ldom_domainchassis', value: 'AK00358110', type: :legacy), an_object_having_attributes(name: 'ldom_domaincontrol', value: 'opdx-a0-sun2', type: :legacy), an_object_having_attributes(name: 'ldom_domainname', value: 'sol11-9', type: :legacy), an_object_having_attributes(name: 'ldom_domainrole_control', value: 'false', type: :legacy), an_object_having_attributes(name: 'ldom_domainrole_impl', value: 'LDoms', type: :legacy), an_object_having_attributes(name: 'ldom_domainrole_io', value: 'false', type: :legacy), an_object_having_attributes(name: 'ldom_domainrole_root', value: 'false', type: :legacy), an_object_having_attributes(name: 'ldom_domainrole_service', value: 'false', type: :legacy), an_object_having_attributes(name: 'ldom_domainuuid', value: 'd7a3a4df-ce8c-47a9-b396-cb5a5f30c0b2',
46-
type: :legacy))
45+
expect(fact.call_the_resolver).to match_array(
46+
[
47+
an_object_having_attributes(name: 'ldom', value: value, type: :core),
48+
an_object_having_attributes(name: 'ldom_domainchassis', value: 'AK00358110', type: :legacy),
49+
an_object_having_attributes(name: 'ldom_domaincontrol', value: 'opdx-a0-sun2', type: :legacy),
50+
an_object_having_attributes(name: 'ldom_domainname', value: 'sol11-9', type: :legacy),
51+
an_object_having_attributes(name: 'ldom_domainrole_control', value: 'false', type: :legacy),
52+
an_object_having_attributes(name: 'ldom_domainrole_impl', value: 'LDoms', type: :legacy),
53+
an_object_having_attributes(name: 'ldom_domainrole_io', value: 'false', type: :legacy),
54+
an_object_having_attributes(name: 'ldom_domainrole_root', value: 'false', type: :legacy),
55+
an_object_having_attributes(name: 'ldom_domainrole_service', value: 'false', type: :legacy),
56+
an_object_having_attributes(name: 'ldom_domainuuid', value: 'd7a3a4df-ce8c-47a9-b396-cb5a5f30c0b2',
57+
type: :legacy)
58+
]
59+
)
4760
end
4861
end
4962

0 commit comments

Comments
 (0)