Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added some unsafe rubocop fixes #71

Merged
merged 1 commit into from
Aug 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 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 2023-08-23 17:58:31 UTC using RuboCop version 1.54.2.
# on 2023-08-26 05:38:06 UTC using RuboCop version 1.54.2.
# 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 Down Expand Up @@ -77,7 +77,7 @@ RSpec/RepeatedDescription:
Exclude:
- 'spec/puppet-lint/plugins/ghostbuster_facts_spec.rb'

# Offense count: 13
# Offense count: 9
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: nested, compact
Expand All @@ -91,13 +91,9 @@ Style/ClassAndModuleChildren:
- 'lib/puppet-lint/plugins/check_ghostbuster_hiera_files.rb'
- 'lib/puppet-lint/plugins/check_ghostbuster_templates.rb'
- 'lib/puppet-lint/plugins/check_ghostbuster_types.rb'
- 'spec/fixtures/modules/foo/lib/puppet/parser/functions/bar.rb'
- 'spec/fixtures/modules/foo/lib/puppet/parser/functions/baz.rb'
- 'spec/fixtures/modules/foo/lib/puppet/parser/functions/foo.rb'
- 'spec/fixtures/modules/foo/lib/puppet/parser/functions/quux.rb'
- 'spec/spec_helper.rb'

# Offense count: 3
# Offense count: 5
Style/ClassVars:
Exclude:
- 'lib/puppet-ghostbuster/puppetdb.rb'
Expand All @@ -118,12 +114,23 @@ Style/Documentation:
- 'lib/puppet-lint/plugins/check_ghostbuster_templates.rb'
- 'lib/puppet-lint/plugins/check_ghostbuster_types.rb'

# Offense count: 33
# Offense count: 11
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Style/FrozenStringLiteralComment:
Enabled: false
Exclude:
- 'lib/puppet-ghostbuster/puppetdb.rb'
- 'lib/puppet-ghostbuster/version.rb'
- 'lib/puppet-lint/plugins/check_ghostbuster_classes.rb'
- 'lib/puppet-lint/plugins/check_ghostbuster_defines.rb'
- 'lib/puppet-lint/plugins/check_ghostbuster_facts.rb'
- 'lib/puppet-lint/plugins/check_ghostbuster_files.rb'
- 'lib/puppet-lint/plugins/check_ghostbuster_functions.rb'
- 'lib/puppet-lint/plugins/check_ghostbuster_hiera_files.rb'
- 'lib/puppet-lint/plugins/check_ghostbuster_templates.rb'
- 'lib/puppet-lint/plugins/check_ghostbuster_types.rb'
- 'spec/spec_helper.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

source ENV['GEM_SOURCE'] || 'https://rubygems.org'

gemspec
Expand Down
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec)
Expand Down
2 changes: 2 additions & 0 deletions puppet-ghostbuster.gemspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

$LOAD_PATH.unshift File.expand_path('lib', __dir__)
require 'puppet-ghostbuster/version'

Expand Down
2 changes: 2 additions & 0 deletions spec/fixtures/modules/foo/lib/facter/bar.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Fact used in manifest
Facter.add('bar') do
setcode do
Expand Down
2 changes: 2 additions & 0 deletions spec/fixtures/modules/foo/lib/facter/baz.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Fact used in template
Facter.add('baz') do
setcode do
Expand Down
2 changes: 2 additions & 0 deletions spec/fixtures/modules/foo/lib/facter/foo.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Fact used in a string
Facter.add('foo') do
setcode do
Expand Down
2 changes: 2 additions & 0 deletions spec/fixtures/modules/foo/lib/facter/multi.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Unused facts
Facter.add('multi1') do
setcode do
Expand Down
2 changes: 2 additions & 0 deletions spec/fixtures/modules/foo/lib/facter/quux.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Fact used in inline_template
Facter.add('quux') do
setcode do
Expand Down
10 changes: 8 additions & 2 deletions spec/fixtures/modules/foo/lib/puppet/parser/functions/bar.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
module Puppet::Parser::Functions
newfunction(:bar, type: :rvalue) do |arguments|
# frozen_string_literal: true

module Puppet
module Parser
module Functions
newfunction(:bar, type: :rvalue) do |arguments|
end
end
end
end
10 changes: 8 additions & 2 deletions spec/fixtures/modules/foo/lib/puppet/parser/functions/baz.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
module Puppet::Parser::Functions
newfunction(:baz, type: :rvalue) do |arguments|
# frozen_string_literal: true

module Puppet
module Parser
module Functions
newfunction(:baz, type: :rvalue) do |arguments|
end
end
end
end
10 changes: 8 additions & 2 deletions spec/fixtures/modules/foo/lib/puppet/parser/functions/foo.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
module Puppet::Parser::Functions
newfunction(:foo, type: :rvalue) do |arguments|
# frozen_string_literal: true

module Puppet
module Parser
module Functions
newfunction(:foo, type: :rvalue) do |arguments|
end
end
end
end
10 changes: 8 additions & 2 deletions spec/fixtures/modules/foo/lib/puppet/parser/functions/quux.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
module Puppet::Parser::Functions
newfunction(:quux, type: :rvalue) do |arguments|
# frozen_string_literal: true

module Puppet
module Parser
module Functions
newfunction(:quux, type: :rvalue) do |arguments|
end
end
end
end
2 changes: 2 additions & 0 deletions spec/fixtures/modules/foo/lib/puppet/type/bar.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# frozen_string_literal: true

Puppet::Type.newtype(:bar) do
end
2 changes: 2 additions & 0 deletions spec/fixtures/modules/foo/lib/puppet/type/foo.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# frozen_string_literal: true

Puppet::Type.newtype(:foo) do
end
2 changes: 2 additions & 0 deletions spec/puppet-lint/plugins/ghostbuster_classes_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

describe 'ghostbuster_classes' do
Expand Down
2 changes: 2 additions & 0 deletions spec/puppet-lint/plugins/ghostbuster_defines_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

describe 'ghostbuster_defines' do
Expand Down
2 changes: 2 additions & 0 deletions spec/puppet-lint/plugins/ghostbuster_facts_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

describe 'ghostbuster_facts' do
Expand Down
2 changes: 2 additions & 0 deletions spec/puppet-lint/plugins/ghostbuster_files_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

describe 'ghostbuster_files' do
Expand Down
2 changes: 2 additions & 0 deletions spec/puppet-lint/plugins/ghostbuster_functions_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

describe 'ghostbuster_functions' do
Expand Down
2 changes: 2 additions & 0 deletions spec/puppet-lint/plugins/ghostbuster_hiera_files_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

ENV['HIERA_YAML_PATH'] = './spec/fixtures/hiera.yaml'
Expand Down
2 changes: 2 additions & 0 deletions spec/puppet-lint/plugins/ghostbuster_templates_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

describe 'ghostbuster_templates' do
Expand Down
2 changes: 2 additions & 0 deletions spec/puppet-lint/plugins/ghostbuster_types_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

describe 'ghostbuster_types' do
Expand Down