Sha256: 25f18f679c82edee2703693f6a9a1e0fa4359b05a81fc761a5409c8fbbf38cf7

Contents?: true

Size: 1.19 KB

Versions: 124

Compression:

Stored size: 1.19 KB

Contents

module Puppet::Pops
module Validation
# Configures validation suitable for 4.0
#
class ValidatorFactory_4_0 < Factory
  Issues = Issues

  # Produces the checker to use
  def checker diagnostic_producer
    if Puppet[:tasks]
      require_relative 'tasks_checker'
      TasksChecker.new(diagnostic_producer)
    else
      Checker4_0.new(diagnostic_producer)
    end
  end

  # Produces the label provider to use
  def label_provider
    Model::ModelLabelProvider.new()
  end

  # Produces the severity producer to use
  def severity_producer
    p = super

    # Configure each issue that should **not** be an error
    #
    # Validate as per the current runtime configuration
    p[Issues::RT_NO_STORECONFIGS_EXPORT]      = Puppet[:storeconfigs] ? :ignore : :warning
    p[Issues::RT_NO_STORECONFIGS]             = Puppet[:storeconfigs] ? :ignore : :warning

    p[Issues::FUTURE_RESERVED_WORD]           = :deprecation

    p[Issues::DUPLICATE_KEY]                  = Puppet[:strict] == :off ? :ignore : Puppet[:strict]
    p[Issues::NAME_WITH_HYPHEN]               = :error
    p[Issues::EMPTY_RESOURCE_SPECIALIZATION]  = :ignore
    p[Issues::CLASS_NOT_VIRTUALIZABLE]        = :error
    p
  end
end
end
end

Version data entries

124 entries across 124 versions & 1 rubygems

Version Path
puppet-7.29.0 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-7.29.0-x86-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-7.29.0-x64-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-7.29.0-universal-darwin lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-7.28.0 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-7.28.0-x86-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-7.28.0-x64-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-7.28.0-universal-darwin lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-7.27.0 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-7.27.0-x86-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-7.27.0-x64-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-7.27.0-universal-darwin lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-7.26.0 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-7.26.0-x86-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-7.26.0-x64-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-7.26.0-universal-darwin lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-7.25.0 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-7.25.0-x86-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-7.25.0-x64-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-7.25.0-universal-darwin lib/puppet/pops/validation/validator_factory_4_0.rb