lib/pdk/validate/puppet/puppet_lint_validator.rb in pdk-2.7.1 vs lib/pdk/validate/puppet/puppet_lint_validator.rb in pdk-3.0.0
- old
+ new
@@ -15,11 +15,11 @@
def pattern
contextual_pattern('**/*.pp')
end
def spinner_text_for_targets(_targets)
- 'Checking Puppet manifest style (%{pattern}).' % { pattern: pattern.join(' ') }
+ format('Checking Puppet manifest style (%{pattern}).', pattern: pattern.join(' '))
end
def parse_options(targets)
cmd_options = ['--json', '--relative']
@@ -38,27 +38,27 @@
# puppet-lint does not include files without problems in its JSON
# output, so we need to go through the list of targets and add passing
# events to the report for any target not listed in the JSON output.
targets.reject { |target| json_data.any? { |j| j['path'] == target } }.each do |target|
report.add_event(
- file: target,
- source: name,
+ file: target,
+ source: name,
severity: 'ok',
- state: :passed,
+ state: :passed
)
end
json_data.each do |offense|
- report.add_event(
- file: offense['path'],
- source: name,
- line: offense['line'],
- column: offense['column'],
- message: offense['message'],
- test: offense['check'],
- severity: (offense['kind'] == 'fixed') ? 'corrected' : offense['kind'],
- state: :failure,
- )
+ report.add_event({
+ file: offense['path'],
+ source: name,
+ line: offense['line'],
+ column: offense['column'],
+ message: offense['message'],
+ test: offense['check'],
+ severity: offense['kind'] == 'fixed' ? 'corrected' : offense['kind'],
+ state: :failure
+ })
end
end
end
end
end