Sha256: 96e993501136da5f3b25dec74a65fc59ce1adfc8d20ca6e45625c698fb838bf8

Contents?: true

Size: 1.2 KB

Versions: 40

Compression:

Stored size: 1.2 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
    Checker4_0.new(diagnostic_producer)
  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::DUPLICATE_DEFAULT]             = Puppet[:strict] == :off ? :ignore : Puppet[:strict]
    p[Issues::NAME_WITH_HYPHEN]              = :error
    p[Issues::EMPTY_RESOURCE_SPECIALIZATION] = :ignore
    p[Issues::CLASS_NOT_VIRTUALIZABLE]      = Puppet[:strict] == :off ? :warning : Puppet[:strict]
    p
  end
end
end
end

Version data entries

40 entries across 40 versions & 2 rubygems

Version Path
puppet-retrospec-1.8.0 vendor/pup410/lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-retrospec-1.7.0 vendor/pup410/lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.10.12 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.10.12-x86-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.10.12-x64-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.10.12-universal-darwin lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.10.11 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.10.11-x86-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.10.11-x64-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.10.11-universal-darwin lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.10.10 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.10.10-x86-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.10.10-x64-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.10.10-universal-darwin lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-retrospec-1.6.1 vendor/pup410/lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-retrospec-1.6.0 vendor/pup410/lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.10.9 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.10.9-x86-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.10.9-x64-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.10.9-universal-darwin lib/puppet/pops/validation/validator_factory_4_0.rb