Module: OpenvoxLint

Defined in:
lib/openvox-lint.rb,
lib/openvox-lint/cli.rb,
lib/openvox-lint/lexer.rb,
lib/openvox-lint/token.rb,
lib/openvox-lint/checks.rb,
lib/openvox-lint/linter.rb,
lib/openvox-lint/report.rb,
lib/openvox-lint/version.rb,
lib/openvox-lint/check_plugin.rb,
lib/openvox-lint/configuration.rb

Overview

OpenvoxLint – a style-guide linter for OpenVox / Puppet manifests.

Compatible with:

- OpenVox 8.x (community fork of Puppet)
- Puppet 8.x
- Legacy Puppet 7.x manifests (with deprecation warnings)

Defined Under Namespace

Classes: CLI, CheckPlugin, Checks, Configuration, Error, Lexer, Linter, NoFix, Report, Token

Constant Summary collapse

VERSION =
'1.3.0'

Class Method Summary collapse

Class Method Details

.checksObject



39
40
41
# File 'lib/openvox-lint.rb', line 39

def checks
  @checks ||= {}
end

.configurationObject



24
25
26
# File 'lib/openvox-lint.rb', line 24

def configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



28
29
30
# File 'lib/openvox-lint.rb', line 28

def configure
  yield(configuration)
end

.new_check(name, &block) ⇒ Object



43
44
45
46
47
48
49
50
# File 'lib/openvox-lint.rb', line 43

def new_check(name, &block)
  if checks.key?(name)
    $stderr.puts "openvox-lint: warning: check '#{name}' is already registered — overwriting" if ENV['OPENVOX_LINT_DEBUG']
  end
  klass = Class.new(CheckPlugin, &block)
  klass.instance_variable_set(:@check_name, name)
  checks[name] = klass
end

.reset_configuration!Object

Reset the global configuration singleton. Called at the start of every CLI run so that repeated invocations in the same Ruby process (Vim plugins, guard, Rake loops) start clean.



35
36
37
# File 'lib/openvox-lint.rb', line 35

def reset_configuration!
  @configuration = Configuration.new
end