Class: Puppet::Pops::Validation::ValidatorFactory_4_0 Private

Inherits:
Factory show all
Defined in:
lib/puppet/pops/validation/validator_factory_4_0.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Configures validation suitable for 4.0

Instance Method Summary collapse

Methods inherited from Factory

#diagnostic_producer, #validator

Instance Method Details

#checker(diagnostic_producer) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Produces the checker to use



9
10
11
12
13
14
15
16
# File 'lib/puppet/pops/validation/validator_factory_4_0.rb', line 9

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

#label_providerObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Produces the label provider to use



19
20
21
# File 'lib/puppet/pops/validation/validator_factory_4_0.rb', line 19

def label_provider
  Model::ModelLabelProvider.new()
end

#severity_producerObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Produces the severity producer to use



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/puppet/pops/validation/validator_factory_4_0.rb', line 24

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[Issues::ILLEGAL_NONLITERAL_PARAMETER_TYPE] = :deprecation
  p
end