Skip to content

Commit ad545d5

Browse files
authored
Merge pull request #40 from bastelfreak/rubocop
pin rubocop to < 1.79
2 parents f888c0b + 5c8afe9 commit ad545d5

5 files changed

Lines changed: 36 additions & 27 deletions

File tree

.github/workflows/checks.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ jobs:
2626
with:
2727
ruby-version: '2.7'
2828
bundler-cache: true
29-
- run: bundle exec rubocop --parallel
29+
- run: bundle exec rake rubocop
3030
- run: gem build --strict --verbose *.gemspec

.rubocop_todo.yml

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
# This configuration was generated by
2-
# `rubocop --auto-gen-config`
3-
# on 2024-01-08 20:12:30 UTC using RuboCop version 1.59.0.
2+
# `rubocop --auto-gen-config --no-auto-gen-timestamp`
3+
# using RuboCop version 1.78.0.
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+
919
# Offense count: 3
1020
# This cop supports safe autocorrection (--autocorrect).
1121
Performance/RegexpMatch:
@@ -18,35 +28,21 @@ Performance/RegexpMatch:
1828
RSpec/FilePath:
1929
Enabled: false
2030

21-
# Need to remove logger class variables
31+
# Offense count: 14
2232
Style/ClassVars:
2333
Exclude:
2434
- 'lib/facter/framework/logging/logger.rb'
2535
- 'spec/custom_facts/puppetlabs_spec/files.rb'
26-
- 'spec/facter/util/file_helper_spec.rb'
27-
- 'spec/framework/core/fact/internal/internal_fact_manager_spec.rb'
2836
- 'spec/framework/logging/logger_spec.rb'
2937

38+
# Offense count: 981
39+
# Configuration parameters: AllowedConstants.
3040
Style/Documentation:
31-
Exclude:
32-
- 'lib/facter.rb' # should be documented
33-
- 'lib/facter/config.rb' # should be documented
34-
- 'lib/facter/custom_facts/**/*' # should be documented
35-
- 'lib/facter/facts/**/*' # don't care
36-
- 'lib/facter/framework/**/*' # should be documented
37-
- 'lib/facter/models/**/*' # should be documented
38-
- 'lib/facter/resolvers/**/*' # don't care
39-
- 'lib/facter/util/**/*'
40-
- 'lib/facter/version.rb' # auto updated
41-
- 'spec/**/*'
42-
- 'spec_integration/**/*'
43-
- 'scripts/*'
44-
- 'install.rb'
41+
Enabled: false
4542

46-
# While it would be preferable to use a keyword argument for the proxy setting in #get_request and #put_request, if we
47-
# add keyword arguments to those methods Ruby < 3 misinterprets earlier positional arguments as a keyword arguments.
48-
# This is because those positional arguments are hashes that use symbols as keys.
49-
# TODO: revisit this after we drop Ruby < 3 support.
43+
# Offense count: 2
44+
# Configuration parameters: AllowedMethods.
45+
# AllowedMethods: respond_to_missing?
5046
Style/OptionalBooleanParameter:
5147
Exclude:
52-
- 'lib/facter/util/resolvers/http.rb'
48+
- 'lib/facter/util/resolvers/http.rb'

Rakefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,16 @@ end
7777

7878
desc 'Prepare for a release'
7979
task 'release:prepare' => [:changelog]
80+
81+
begin
82+
require 'rubocop/rake_task'
83+
rescue LoadError
84+
# Do nothing if no required gem installed
85+
else
86+
RuboCop::RakeTask.new(:rubocop) do |task|
87+
# These make the rubocop experience maybe slightly less terrible
88+
task.options = ['--display-cop-names', '--display-style-guide', '--extra-details']
89+
# Use Rubocop's Github Actions formatter if possible
90+
task.formatters << 'github' if ENV['GITHUB_ACTIONS'] == 'true'
91+
end
92+
end

openfact.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
3838
spec.add_development_dependency 'ffi', '>= 1.15.5', '< 1.17.0', '!= 1.16.0', '!= 1.16.1', '!= 1.16.2'
3939
spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
4040
spec.add_development_dependency 'rspec', '~> 3.0'
41-
spec.add_development_dependency 'rubocop', '~> 1.28' # last version to support 2.5
41+
spec.add_development_dependency 'rubocop', '~> 1.28', '< 1.79'
4242
spec.add_development_dependency 'rubocop-performance', '~> 1.5.2'
4343
spec.add_development_dependency 'rubocop-rspec', '~> 2.10' # last version to support 2.5
4444
spec.add_development_dependency 'simplecov', '~> 0.17.1'

spec/facter/util/windows/network_utils_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
Ps = Struct.new(:PhysicalAddress, :PhysicalAddressLength)
3+
Ps = Struct.new(:PhysicalAddress, :PhysicalAddressLength) # rubocop:disable Naming/MethodName
44

55
describe NetworkUtils do
66
describe '#address_to_string' do

0 commit comments

Comments
 (0)