Skip to content

Commit

Permalink
Merge pull request #1959 from puppetlabs/FACT-2677-rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Gheorghe Popescu authored Jul 10, 2020
2 parents af2021e + d494f31 commit 353bf71
Show file tree
Hide file tree
Showing 659 changed files with 498 additions and 231 deletions.
93 changes: 49 additions & 44 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Layout/LineLength:

Lint/RescueException:
Exclude:
- 'lib/custom_facts/util/parser.rb'
- 'lib/facter/custom_facts/util/parser.rb'

Lint/RaiseException:
Enabled: true
Expand All @@ -26,18 +26,19 @@ Lint/StructNewOverride:
Metrics/MethodLength:
Max: 20
Exclude:
- 'lib/custom_facts/util/values.rb'
- 'lib/custom_facts/util/confine.rb'
- 'lib/custom_facts/core/execution/windows.rb'
- 'lib/custom_facts/core/execution/base.rb'
- 'lib/framework/detector/os_detector.rb'
- 'lib/resolvers/bsd/ffi/ffi_helper.rb'
- 'lib/facter/custom_facts/util/values.rb'
- 'lib/facter/custom_facts/util/confine.rb'
- 'lib/facter/custom_facts/core/execution/windows.rb'
- 'lib/facter/custom_facts/core/execution/base.rb'
- 'lib/facter/framework/detector/os_detector.rb'
- 'lib/facter/resolvers/bsd/ffi/ffi_helper.rb'
- 'install.rb'

Metrics/ModuleLength:
Max: 100
Exclude:
- 'lib/facter.rb'
- 'lib/facter-ng.rb'
- 'agent/lib/facter-ng.rb'

Metrics/BlockLength:
Exclude:
Expand All @@ -52,51 +53,55 @@ Metrics/AbcSize:
Exclude:
- 'spec/custom_facts/util/parser_spec.rb'
- 'spec/custom_facts/core/logging_spec.rb'
- 'lib/custom_facts/util/values.rb'
- 'lib/custom_facts/util/loader.rb'
- 'lib/custom_facts/util/confine.rb'
- 'lib/custom_facts/util/confine.rb'
- 'lib/custom_facts/core/execution/windows.rb'
- 'lib/custom_facts/core/execution/base.rb'
- 'lib/custom_facts/core/resolvable.rb'
- 'lib/resolvers/bsd/ffi/ffi_helper.rb'
- 'lib/facter/custom_facts/util/values.rb'
- 'lib/facter/custom_facts/util/loader.rb'
- 'lib/facter/custom_facts/util/confine.rb'
- 'lib/facter/custom_facts/util/confine.rb'
- 'lib/facter/custom_facts/core/execution/windows.rb'
- 'lib/facter/custom_facts/core/execution/base.rb'
- 'lib/facter/custom_facts/core/resolvable.rb'
- 'lib/facter/resolvers/bsd/ffi/ffi_helper.rb'
- 'install.rb'

Metrics/PerceivedComplexity:
Exclude:
- 'lib/custom_facts/util/values.rb'
- 'lib/custom_facts/util/confine.rb'
- 'lib/custom_facts/core/execution/windows.rb'
- 'lib/custom_facts/core/execution/posix.rb'
- 'lib/facter/custom_facts/util/values.rb'
- 'lib/facter/custom_facts/util/confine.rb'
- 'lib/facter/custom_facts/core/execution/windows.rb'
- 'lib/facter/custom_facts/core/execution/posix.rb'
- 'install.rb'

Metrics/CyclomaticComplexity:
Exclude:
- 'lib/custom_facts/util/values.rb'
- 'lib/custom_facts/util/confine.rb'
- 'lib/custom_facts/core/execution/windows.rb'
- 'lib/custom_facts/core/execution/posix.rb'
- 'lib/framework/detector/os_detector.rb'
- 'lib/facter/custom_facts/util/values.rb'
- 'lib/facter/custom_facts/util/confine.rb'
- 'lib/facter/custom_facts/core/execution/windows.rb'
- 'lib/facter/custom_facts/core/execution/posix.rb'
- 'lib/facter/framework/detector/os_detector.rb'
- 'install.rb'

Metrics/ClassLength:
Exclude:
- 'lib/custom_facts/util/fact.rb'
- 'lib/resolvers/windows/networking_resolver.rb'
- 'lib/custom_facts/util/collection.rb'
- 'lib/framework/core/options/option_store.rb'
- 'lib/framework/cli/cli.rb'
- 'lib/resolvers/networking_linux_resolver.rb'
- 'lib/framework/core/cache_manager.rb'
- 'lib/facter/custom_facts/util/fact.rb'
- 'lib/facter/resolvers/windows/networking_resolver.rb'
- 'lib/facter/custom_facts/util/collection.rb'
- 'lib/facter/framework/core/options/option_store.rb'
- 'lib/facter/framework/cli/cli.rb'
- 'lib/facter/resolvers/networking_linux_resolver.rb'
- 'lib/facter/framework/core/cache_manager.rb'
- 'install.rb'

Naming/AccessorMethodName:
Exclude:
- 'lib/custom_facts/core/suitable.rb'
- 'lib/facter/custom_facts/core/suitable.rb'

Naming/MethodName:
Exclude:
- 'spec/mocks/**/*'

Naming/PredicateName:
Exclude:
- 'lib/custom_facts/core/suitable.rb'
- 'lib/facter/custom_facts/core/suitable.rb'

Naming/FileName:
Exclude:
Expand Down Expand Up @@ -125,24 +130,24 @@ Style/FrozenStringLiteralComment:
- 'spec/custom_facts/shared_contexts/platform.rb'
- 'spec/custom_facts/core/execution/windows_spec.rb'
- 'spec/custom_facts/core/execution/posix_spec.rb'
- 'lib/custom_facts/util/resolution.rb'
- 'lib/custom_facts/core/execution/windows.rb'
- 'lib/custom_facts/core/execution/posix.rb'
- 'lib/facter/custom_facts/util/resolution.rb'
- 'lib/facter/custom_facts/core/execution/windows.rb'
- 'lib/facter/custom_facts/core/execution/posix.rb'

Style/TrivialAccessors:
AllowDSLWriters: true

Style/CaseEquality:
Exclude:
- 'spec/custom_facts/util/confine_spec.rb'
- 'lib/custom_facts/util/confine.rb'
- 'lib/facter/custom_facts/util/confine.rb'

Style/DoubleNegation:
Exclude:
- 'lib/custom_facts/util/confine.rb'
- 'lib/custom_facts/util/confine.rb'
- 'lib/custom_facts/core/execution/windows.rb'
- 'lib/custom_facts/core/execution/posix.rb'
- 'lib/facter/custom_facts/util/confine.rb'
- 'lib/facter/custom_facts/util/confine.rb'
- 'lib/facter/custom_facts/core/execution/windows.rb'
- 'lib/facter/custom_facts/core/execution/posix.rb'

Style/MethodMissingSuper:
Exclude:
Expand All @@ -154,11 +159,11 @@ Style/MissingRespondToMissing:

Style/StderrPuts:
Exclude:
- 'lib/custom_facts/core/logging.rb'
- 'lib/facter/custom_facts/core/logging.rb'

Style/ModuleFunction:
Exclude:
- 'lib/custom_facts/core/logging.rb'
- 'lib/facter/custom_facts/core/logging.rb'

Style/HashEachMethods:
Enabled: false # not implemted in ruby 2.3
Expand Down
23 changes: 0 additions & 23 deletions acceptance/tests/ticket_1123_facter_with_invalid_locale.rb

This file was deleted.

8 changes: 3 additions & 5 deletions agent/facter-ng.gemspec
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# frozen_string_literal: true

lib = File.expand_path('../lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require_relative '../config/config'
require_relative '../lib/facter/config/config'

Gem::Specification.new do |spec|
spec.name = 'facter-ng'
Expand All @@ -23,7 +21,7 @@ Gem::Specification.new do |spec|

spec.required_ruby_version = '~> 2.3'
spec.files.reject! do |f|
f.match(%r{^(test|spec|features)/})
f.match(%r{^(test|spec|features|acceptance)/})
end

spec.files.reject! do |f|
Expand All @@ -32,7 +30,7 @@ Gem::Specification.new do |spec|

spec.bindir = 'bin'
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.require_paths = ['agent/lib']
spec.require_paths = ['agent/lib', 'lib']

spec.add_development_dependency 'bundler', '~> 2.0'
spec.add_development_dependency 'coveralls', '~> 0.8.23'
Expand Down
3 changes: 1 addition & 2 deletions bin/facter
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# frozen_string_literal: true

require 'pathname'
ROOT_DIR = Pathname.new(File.expand_path('..', __dir__)) unless defined?(ROOT_DIR)
require "#{ROOT_DIR}/lib/framework/cli/cli_launcher.rb"
require 'facter/framework/cli/cli_launcher.rb'

cli_launcher = CliLauncher.new(ARGV)

Expand Down
4 changes: 1 addition & 3 deletions bin/facter-ng
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require 'pathname'
ROOT_DIR = Pathname.new(File.expand_path('..', __dir__)) unless defined?(ROOT_DIR)
require "#{ROOT_DIR}/lib/framework/cli/cli_launcher.rb"
require 'facter/framework/cli/cli_launcher.rb'

cli_launcher = CliLauncher.new(ARGV)

Expand Down
6 changes: 0 additions & 6 deletions config/config.rb

This file was deleted.

6 changes: 2 additions & 4 deletions facter.gemspec
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# frozen_string_literal: true

lib = File.expand_path('../lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require_relative 'config/config'
require_relative 'lib/facter/config/config'

Gem::Specification.new do |spec|
spec.name = 'facter'
Expand All @@ -24,7 +22,7 @@ Gem::Specification.new do |spec|

spec.required_ruby_version = '~> 2.3'
spec.files.reject! do |f|
f.match(%r{^(test|spec|features)/})
f.match(%r{^(test|spec|features|acceptance)/})
end

spec.files.reject! do |f|
Expand Down
Loading

0 comments on commit 353bf71

Please sign in to comment.