Skip to content

Commit

Permalink
rubocop: autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Sep 5, 2024
1 parent 4813d11 commit 8c25f3b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 24 deletions.
49 changes: 27 additions & 22 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-01-08 20:12:30 UTC using RuboCop version 1.59.0.
# on 2024-09-05 20:01:51 UTC using RuboCop version 1.64.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -18,35 +18,40 @@ Performance/RegexpMatch:
RSpec/FilePath:
Enabled: false

# Need to remove logger class variables
# Offense count: 14
Style/ClassVars:
Exclude:
- 'lib/facter/framework/logging/logger.rb'
- 'spec/custom_facts/puppetlabs_spec/files.rb'
- 'spec/facter/util/file_helper_spec.rb'
- 'spec/framework/core/fact/internal/internal_fact_manager_spec.rb'
- 'spec/framework/logging/logger_spec.rb'

# Offense count: 977
# Configuration parameters: AllowedConstants.
Style/Documentation:
Enabled: false

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/IdenticalConditionalBranches:
Exclude:
- 'lib/facter.rb' # should be documented
- 'lib/facter/config.rb' # should be documented
- 'lib/facter/custom_facts/**/*' # should be documented
- 'lib/facter/facts/**/*' # don't care
- 'lib/facter/framework/**/*' # should be documented
- 'lib/facter/models/**/*' # should be documented
- 'lib/facter/resolvers/**/*' # don't care
- 'lib/facter/util/**/*'
- 'lib/facter/version.rb' # auto updated
- 'spec/**/*'
- 'spec_integration/**/*'
- 'scripts/*'
- 'install.rb'
- 'lib/docs/generate.rb'

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

# Offense count: 13
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/SlicingWithRange:
Exclude:
- 'install.rb'
- 'lib/facter/facts/solaris/ldom.rb'
- 'lib/facter/framework/cli/cli.rb'
- 'lib/facter/resolvers/aix/serialnumber.rb'
- 'lib/facter/resolvers/freebsd/swap_memory.rb'
- 'lib/facter/resolvers/networking.rb'
- 'lib/facter/resolvers/partitions.rb'
- 'lib/facter/util/api_debugger.rb'
2 changes: 1 addition & 1 deletion lib/docs/generate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def format_facts(fact_hash)
erb = if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+
ERB.new(File.read(PATH_TO_TEMPLATE), trim_mode: '-')
else
ERB.new(File.read(PATH_TO_TEMPLATE), nil, '-')
ERB.new(File.read(PATH_TO_TEMPLATE), trim_mode: '-')
end
erb.result(scope.instance_eval { binding })
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facter/framework/cli/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def man(*args)
negate_options = %w[block cache custom_facts external_facts]

template = File.join(File.dirname(__FILE__), '..', '..', 'templates', 'man.erb')
erb = ERB.new(File.read(template), nil, '-')
erb = ERB.new(File.read(template), trim_mode: '-')
erb.filename = template
puts erb.result(binding)
end
Expand Down

0 comments on commit 8c25f3b

Please sign in to comment.